I thought i'd have a try at making myself a linked list, get some practise using pointers and such. Anyway, in coding the CNode class i've had these errors:
error C2146: syntax error : missing ';' before identifier 'name'
error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
with this code:
Error C4430 refers to the line 'string name;'. I've tried it with an Int and i dont get the errors, and i've tried including <string> but that doesnt help either. I know it's going to be something stupid, but i just cant see it, thanks for your help.Code:#ifndef CNODE_H #define CNODE_H class CNode { public: CNode(); string name; CNode *next; }; #endif