Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C++ and Visual C++ > Visual C++
|
Visual C++ Questions specific to Microsoft's Visual C++. For questions not specific to this Microsoft version, use the C++ Programming forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual C++ section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 7th, 2005, 01:22 PM
Registered User
 
Join Date: Nov 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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.

 
Old November 13th, 2005, 08:50 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 453
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via AIM to Ankur_Verma Send a message via MSN to Ankur_Verma
Default

There is a class called CLine that you are making use of in this code. Include the header file in which this class is defined. Consult the book if you are not sure about anything else before getting back 'cause you are asking very basic questions.

Regards
Ankur Verma





Similar Threads
Thread Thread Starter Forum Replies Last Post
C/C++ Pointers reality_42000 C++ Programming 1 March 4th, 2007 01:26 AM
pointers Stuby085 Visual C++ 1 August 30th, 2003 11:58 PM
New to C++. Question about pointers jtodora Visual C++ 1 August 21st, 2003 10:28 PM
Pointers and Arrays C++ odie All Other Wrox Books 1 July 10th, 2003 01:45 PM
Pointers jake VB How-To 12 June 21st, 2003 11:30 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.