Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
B

bhangie

@bhangie
About
Posts
22
Topics
15
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Help with Inheritance
    B bhangie

    Thank's for the help oaks.:) Bhangie Education begins a gentleman, conversation completes him ;)

    C / C++ / MFC help oop question learning

  • Help with Inheritance
    B bhangie

    Hi there Below is the code i have written, is there something wrong with my derived class? i am getting a compiler error :No default Constructor available for the Animal class. Or is it the base class , class Animal { public: Animal(const string &name, const char &sex, const string &Colour, int age); ~Animal(); //get amount of food for specific animal int feed_animal(const int &); void display_Info() const; private: string aName; char aSex; string aColour; int aAge; }; class Crocodile : public Animal { public: Crocodile(int jaw_size, const string &move_ment); ~Crocodile(); private: int jaw; string move; }; Animal::Animal(const string &name,const char &sex, const string &Colour, int Age) :aName(name), aSex(sex), aColour(Colour), aAge(age) { //Empty Constructor } Animal::~Animal() { } int Animal::feed_animal(const int &food) { return food; } void Animal::display_Info() const { cout << "Name : " << aName << endl; cout << "Sex : " << aSex << endl; cout << "Colour : " << aColour << endl; cout << "Age : " << aAge << endl; } int main(int argc, char *argv[]) { Animal Crocko("American Aligator", 'M', "Dark Grey", 2); Crocko.feed_animal(25); //In kilograms or grams Crocko.display_animal(); return 0; } thanks in advance Bhangie Education begins a gentleman, conversation completes him ;)

    C / C++ / MFC help oop question learning

  • Copy Constructors
    B bhangie

    Ok i will, thanks for the help guys much appreciated. Thanks. Education begins a gentleman, conversation completes him ;)

    C / C++ / MFC c++ question learning

  • Copy Constructors
    B bhangie

    Hi How would i write c++ code to make sure that a deep copy takes place with the following class definition? class CShop { public: CShop(); ~CShop(); private: CEmployeeContainer* m_pEmployee; char* m_strShopName; }; An explanation will also do rather than code. Thanks in advance. Education begins a gentleman, conversation completes him ;)

    C / C++ / MFC c++ question learning

  • Help with writing class and imp them
    B bhangie

    Hi there I would like some help with this plz if posible. I need to write the following class book and it's implementation, this is what i have done. class book { public: book(const string title,const author,const char isbn[10]); void show_book(); private: const string T; const string A; const char I; }; Ok,the library class must be able to add books. some other stuff aswell. class library { public: library() void add_book(); void display()const; //display all the books on record private: vector<book *> book_list; }; The library class implementation void library::add_book() { book * new_book = new book("Danger","Mike","102- RT34"); book_list.push_back(new_book); } void library::display() const { for(int i = 0; i < book_list.size(); i++) { cout << book_list[i]->show_book() << "\n"; } } First is there any thing wrong with this code? Secondly is there a beter way of writing this code? Thirdly how would i go about adding books at runtime and iterate thru the vector to find a specific book? excuse the english, Thanks in advance I Never said you should like me.I say be yourself, and make a difference

    C / C++ / MFC graphics help question learning

  • How to log date and time
    B bhangie

    Hi I would like to know how to log the date and time and retrieve them at later stage. Someone books to attend a conference i want to log the exact time and date the booking whas made. Do i use the time class and just somehow write these to a file or how do i do that. many thanks Education begins a gentleman, conversation completes him ;)

    C / C++ / MFC tutorial question learning

  • Passing the address of an object in to a Function
    B bhangie

    Hi there Sorry for the Slopy Subject line!. What i whant to know is the following. I have declared a vector of person Objects vector(person) people; //in main I have a confrence class class conf { public: conf(const string &nm, int d); void set_venue(venue *); void cancel_venue(); private: string conference_name; int duration; venue * pvenue; //pointer to venue class } I Have added a data member to the conf class which is a vector of pointers to person vector(person *) registered; and the following member function to register a person who choose to attend a conference. void register_person(????); So this is what i must do, ok so person objects where added to people //vector(person)people; The person running the program gets to decide who will attend a certian confr thus needing to register this person for the confr. By index how would i pass the address of the specified person object to my register_person(????); function and get register_person(????); to append this person object to my registration vector(Containing only registered persons). I am knot sure about this-> register_person(person & registered)? needs to recieve the address of a specified(index) person object. Help me:~ Education begins a gentleman, conversation completes him ;)

    C / C++ / MFC database graphics help question learning

  • messy function that calculates values
    B bhangie

    Hi before any one start slandering me about this code i did not write it(DID NOT). It is a Question :) well kinda(HW) and i realy need help i wont take any offence if i whas told i'm stupid, I just need help. The question is(from Lecturer) (i) Rewrite the following piece of code correcting all the problems found(Given the followng code) void CalculateValues(const int &a, float *b, int &c) { d = 20.4; if(*a = 0) { *a += 1; c = a + d; } else { b = c / d; c = a - b + d; } } Included a Hint: if a=4, b=0.0, c=5 When funct return should be: a=4, b=0.25 and c=24.15. Need help with the prototype and calculations PLEASE:( Many Thanks.

    C / C++ / MFC help question

  • Writing Class definitions
    B bhangie

    Hi there Can someone help me with this? I need to write a program which simulates a computer system in a public library. Working on these four objects - Customer, Books and loans and the library itself. The library needs to collect info about Customer and add customers. Books title, isdn number and so forth. Loans = the date loaned and date returned. Customers must be able to loan books from and return books to the library. Library needs to print out a report containg details of each book and customer for each loan. I would apreciate if some can just give me a starting point example of how to implement this. Also links to places where i can go thru similar code thanks in advance Bhangie

    C / C++ / MFC tutorial sales help question learning

  • Functions
    B bhangie

    firstly how to write a function prototype that does a deep copy (not a copy of the values only). Secondly how would i write a member function from your perspective. What is the deference between operator=() and Copy()? The code above compiles but is it the write way to do it taking what i have stated in my thread in to mind?

    C / C++ / MFC question database help

  • Functions
    B bhangie

    Hi Can someone please help me with this. :( Given the following-> Write a function called Copy, witch takes two parameters of type string. The first par is your Source(string to be copied) second is your Dest string(target) this function need not return anything(NOT ALLOWED TO USE strcpy) I need to show how i would use this function(call) by writing code that copy one string into another. A deep copy should take place not Shallow. How can i implement the following in my function clear, erase, resize, append and index operator. How does the following piece of code look? #include #include using namespace std; void Copy(string * Source, string * Destination);//???? int main() { string Source = "Robile"; string Destination = "Lance"; Source.append(Destination); Copy(&Source , &Destination); } void Copy(string * Source, string * Destination) { cout << "Destination String Now is " << *Destination << "\n"; } Not asking for complete code just tips on what to do and howto(Correction of code above) Thanks in advance

    C / C++ / MFC question database help

  • Pointers
    B bhangie

    Hi I would like to know why do we realy need pointers is it posible to write a program without the use of pointers. Explain the free store and the heap MyAp *YourAp = new MyAp; is this accessing the free store An example would be nice thanks Kind of a beginner. thanks in advance.

    C / C++ / MFC tutorial learning

  • HELP PLEASE!
    B bhangie

    Hi there I would just like to know how do i write a programme that would take an error code as a argument and display the error message thats associated with the error code Example: ERROR CODE 00300 Print : Bad IP Checksum How and in what should i store the list of errors How do i iterate\scan thru the list get the error code and print the error message. Can i store both in one file? ;)

    C / C++ / MFC help question tutorial

  • Dynamic memory
    B bhangie

    Hi there Can anyone advise. I have a class called Employee ok. Now i want the user to create employees by adding a name, empid and so on. Creating an Employee object // Employee *NewEmp = new Emp ?? I want the new employees details in a file .dat it keeps on creating one employee overriding the previous info. How can i create more than one employee Hit me over the knuckles if im way of! Am i using new wrong? or am i missing the hole new concept totaly thanks:-D

    C / C++ / MFC question performance

  • Shallow copy
    B bhangie

    hi can someone tell me exactly what a shallow copy does it or is it a refrence is it good or bad to use ;)

    C / C++ / MFC

  • Code to read thru
    B bhangie

    hi I need to know where i can find some code to study thru iv'e looked but only finds snippets i want like complete applications that i can study and work thru they say its a good thing to do:) regards

    C / C++ / MFC

  • Vectors
    B bhangie

    Thanks oaks got a better better understanding now! bhangie

    C / C++ / MFC graphics help

  • Vectors
    B bhangie

    Thanks YaronNir std::vector cleared up a few stuff ? 0.1,......up until 999.1 push_back(?)(or i + 0.1) display all contents in vector bhangie regards

    C / C++ / MFC graphics help

  • Vectors
    B bhangie

    Hi there I create a vector of size(10) using a for loop to insert values into the vector for(int i = 0; i < 10; ++i) v.push_back(i + 0.1); //Display for(int i = 0; i < 10; ++i) cout << v[i] << "\n"; Only display zero's on screen, When i dont put in an initial size the vector diplays what i want. is it possible and to use v.size() rather than 10 in the for loops, but also displays zero's and warings at compile time. Am i doing something wrong! Help!:-D Regards bhangie

    C / C++ / MFC graphics help

  • new to programming, how do you use a compiler?
    B bhangie

    Hi there I would suggest you get a compiler with a graphical user interface(gui), with icons and buttons to click. Command line compilers can be difficult to use especially for beginners. I'm new to programing myself and i found it to be to huge of a mission since i am a beginner. So i got myself Visual Studio.Net easy to use. There are free gui compilers like Bloodshed witch you can download. http://www.bloodshed.net regards bhangie :)

    C / C++ / MFC question delphi help
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups