954,498 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Header File

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

amarigny
Newbie Poster
3 posts since May 2005
Reputation Points: 10
Solved Threads: 0
 

Looks like you're missing the string library...

#include <string>
using std::string;
marinme
Junior Poster in Training
63 posts since Apr 2005
Reputation Points: 10
Solved Threads: 1
 

Looks like you're missing the string library...

#include <string>
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

amarigny
Newbie Poster
3 posts since May 2005
Reputation Points: 10
Solved Threads: 0
 

Looks like you're missing the string library...

#include <string>
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é

amarigny
Newbie Poster
3 posts since May 2005
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You