| | |
Header File
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: May 2005
Posts: 3
Reputation:
Solved Threads: 0
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
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
•
•
Join Date: Apr 2005
Posts: 63
Reputation:
Solved Threads: 1
Looks like you're missing the string library...
C++ Syntax (Toggle Plain Text)
#include <string> using std::string;
Yeah... I'm lazy. Deal with it.
•
•
Join Date: May 2005
Posts: 3
Reputation:
Solved Threads: 0
•
•
•
•
Originally Posted by marinme
Looks like you're missing the string library...
C++ Syntax (Toggle Plain Text)
#include <string> using std::string;
Andre
•
•
Join Date: May 2005
Posts: 3
Reputation:
Solved Threads: 0
•
•
•
•
Originally Posted by marinme
Looks like you're missing the string library...
C++ Syntax (Toggle Plain Text)
#include <string> using std::string;
Thank you for your help.
Take care,
André
![]() |
Similar Threads
- Header file Generator (C)
- graphices header file (C)
- header file/ classes (C++)
- compile header file (C++)
- Link source code and header file together? (C++)
- How to write a header file (C++)
Other Threads in the C++ Forum
- Previous Thread: C/C++: Dynamically Scoped Language
- Next Thread: Only first out of three calculations is wrong
| Thread Tools | Search this Thread |
api array arrays based beginner binary bitmap c++ c/c++ calculator char char* class classes code coding compile compiler console conversion convert count data database delete deploy developer dll download dynamiccharacterarray email encryption error file forms fstream function functions game generator getline givemetehcodez graph homeworkhelp homeworkhelper iamthwee ifstream input int integer java lib list loop looping loops map math matrix memory multiple news node number numbertoword output parameter pointer problem program programming project proxy python random read recursion recursive reference rpg sorting string strings struct temperature template text tree url variable vector video visual visualstudio win32 windows winsock word wordfrequency wxwidgets





