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

Recommended Answers

All 3 Replies

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

#include <string>
using std::string;

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

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é

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.