Thread: Class Declaration

  1. #1
    /*enjoy*/
    Join Date
    Apr 2004
    Posts
    159

    Exclamation Class Declaration

    Hi everybody,
    I want to know how to declare the class "Compte" into class "Client", Thinks
    Code:
    class Compte
    {
    
    char Num_compte[13];
    char Operation[15];
    char date[20];
    double Montant;
    double update_solde;
    
    };
    
    class Client:public Compte
    {
    
    int CIN;
    char Nom[15];
    char Prenom[15];
    double solde;
    
    public:
    
    
    };

  2. #2
    Registered User
    Join Date
    Feb 2006
    Posts
    155
    compte into class client?
    dont make me laugh

  3. #3
    /*enjoy*/
    Join Date
    Apr 2004
    Posts
    159
    a client have more than one Compte...

  4. #4
    Registered User
    Join Date
    Feb 2006
    Posts
    155
    well here is what your code says, class client extends class compte,
    so it inherits all functions of class compte ,and it can provide new definitions for the virtual functions and also can add more functions of its own,,
    is this what u had in mind?
    >a client have more than one Compte...

    i dont think so,and if u intended polymorphism,u r saying it all wrong.
    Last edited by qqqqxxxx; 03-10-2006 at 06:24 AM.

  5. #5
    Registered User
    Join Date
    Apr 2003
    Posts
    2,663
    Hi,

    Your posts don't make much sense, but that can happen when you are new to a language. Try to describe what you want to be able to do.

    Maybe you want to do this?
    Code:
    class Client
    {
    	Compte anArray[5];  //an array that can store 5 Compte objects
    };
    Last edited by 7stud; 03-10-2006 at 11:35 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Getting an error with OpenGL: collect2: ld returned 1 exit status
    By Lorgon Jortle in forum C++ Programming
    Replies: 6
    Last Post: 05-08-2009, 08:18 PM
  2. how do you resolve this error?
    By -EquinoX- in forum C Programming
    Replies: 32
    Last Post: 11-05-2008, 04:35 PM
  3. Quantum Random Bit Generator
    By shawnt in forum C++ Programming
    Replies: 62
    Last Post: 06-18-2008, 10:17 AM
  4. Dikumud
    By maxorator in forum C++ Programming
    Replies: 1
    Last Post: 10-01-2005, 06:39 AM
  5. Problem with Visual C++ Object-Oriented Programming Book.
    By GameGenie in forum C++ Programming
    Replies: 9
    Last Post: 08-29-2005, 11:21 PM