944,116 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 8638
  • C++ RSS
May 1st, 2005
0

Header File

Expand Post »
Hello,

I am studying C++ at Uni and my coding is not very strong. More to the point I am having issues with my header taking in this string.

The code works in a linear non object oriented code but as I am new to data abstraction I as mentioned earlier having problems with the header file. The header looks like this:

class clientType{

public:

int initialize (clientData client[], int clientSize);
void printRecords (clientData client[], int clientSize);
int delRecArray (clientData client[], int size);
void printSingleRec (clientData client[], int element);
int IDSearch (clientData client[], int clientLength, int targetID);
int addRecArray (clientData client[], int last);

private:
clientData clientRecords[20];
string people;
};

Errors that are bugging:

path\bankheader.h(21) : error C2146: syntax error : missing ';' before identifier 'people'
path\bankheader.h(21) : error C2501: 'string' : missing storage-class or type specifiers
path\bankheader.h(21) : error C2501: 'people' : missing storage-class or type specifiers

Suggestions will be greatly appreciated!

Thanks
Andre
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
amarigny is offline Offline
3 posts
since May 2005
May 1st, 2005
0

Re: Header File

Looks like you're missing the string library...
C++ Syntax (Toggle Plain Text)
  1. #include <string>
  2. using std::string;
Reputation Points: 10
Solved Threads: 1
Junior Poster in Training
marinme is offline Offline
63 posts
since Apr 2005
May 1st, 2005
0

Re: Header File

Quote originally posted by marinme ...
Looks like you're missing the string library...
C++ Syntax (Toggle Plain Text)
  1. #include <string>
  2. using std::string;
Thank you for the reply, I have tried to put in the string header as well but I still got the same errors.

Andre
Reputation Points: 10
Solved Threads: 0
Newbie Poster
amarigny is offline Offline
3 posts
since May 2005
May 1st, 2005
0

Re: Header File

Quote originally posted by marinme ...
Looks like you're missing the string library...
C++ Syntax (Toggle Plain Text)
  1. #include <string>
  2. using std::string;
Sorry my apologies, I only did the #include and not the "using std::string;"

Thank you for your help.

Take care,

André
Reputation Points: 10
Solved Threads: 0
Newbie Poster
amarigny is offline Offline
3 posts
since May 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: C/C++: Dynamically Scoped Language
Next Thread in C++ Forum Timeline: Only first out of three calculations is wrong





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC