I get SyntaxError using pointers in Implementation
Hello, I've started learning Visual C++ with "SAM's Teach Yourself Visual C++ 6 in 21 Days". I have followed the instructions on Day 10 (Single Document Interface Applications):
I've done the typing in stuff twice, but it results in errors both times.
These are the errors i get trying to compile:
[...]sdidoc.h(35) : error C2143: syntax error : missing ';' before '*'
[...]sdidoc.h(35) : error C2501: 'CLine' : missing storage-class or type specifiers
[...]sdidoc.h(35) : error C2501: 'GetLine' : missing storage-class or type specifiers
Three more of these same type on Row 37
here is the code it refers to:
class CSDIDoc : public CDocument
{
[Some irrelevant stuff cut away]
// Implementation
public:
CLine* GetLine(int nIndex); // Row 35
int GetLineCount();
CLine* AddLine(CPoint ptFrom, CPoint ptTo); //Row 37
CObArray m_oaLines;
---
I'm thinking it has something to do with that star. I haven't got the point with placing it in different positions around functions and variables. But it seems to have something to do with pointers at all times =)
Anybody knows what is wrong?
If you need some more of the code to solve the problem, just tell me.
|