CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2003
    Posts
    72

    Angry Including a class

    Hi

    I have these two simple files and I want to add them to a project:

    this the h file

    class OPStringa
    {
    public:
    CString Duplicate(CString s);
    }
    //////////////////////////////////////////////////////
    this is the cpp file

    #include "stdafx.h"
    #include "OPStringa.h"


    CString OPStringa:: Duplicate(CString s)
    {
    CString a;
    a=s+s;
    return a;
    }


    When I build the project I obtain two errors:

    error C2143: syntax error : missing ';' before 'tag::id'
    fatal error C1004: unexpected end of file found

    Please Help me

    Thanks

  2. #2
    Join Date
    Oct 2002
    Location
    Singapore
    Posts
    3,128

    Re: Including a class

    You need a semi-colon right at the end of a class declaration.

    class OPStringa
    {
    public:
    CString Duplicate(CString s);
    };

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured