Strings...

This is a discussion on Strings... within the C++ Programming forums, part of the General Programming Boards category; Well, I'm having trouble figuring out why vc++8 doesn't like strings. Heres my code... EDIT: Code: #include <string> using namespace ...

  1. #1
    using namespace Trooper; St0rmTroop3er's Avatar
    Join Date
    Sep 2003
    Posts
    77

    Strings...

    Well, I'm having trouble figuring out why vc++8 doesn't like strings. Heres my code...

    EDIT:
    Code:
    #include <string>
    using namespace std;
    
    class AminaRPGEngine
    {
    	AminaRPGEngine();
    	~AminaRPGEngine():
    	
    	string GameName;
    	int mapW,mapH,resW,resH;
    
    };
    Error:
    1>c:\documents and settings\rcapote\desktop\soc\source\aminarpgengine .h(7) : error C2969: syntax error : ';' : expected member function definition to end with '}'
    1>c:\documents and settings\rcapote\desktop\soc\source\aminarpgengine .h(7) : error C2061: syntax error : identifier 'GameName'
    1>c:\documents and settings\rcapote\desktop\soc\source\main.cpp(5) : error C2062: type 'int' unexpected
    1>c:\documents and settings\rcapote\desktop\soc\source\main.cpp(6) : error C2630: ';' found in what should be a comma-separated list
    1>c:\documents and settings\rcapote\desktop\soc\source\main.cpp(17) : error C2577: 'AminaRPGEngine' : a destructor cannot have a return type
    1>c:\documents and settings\rcapote\desktop\soc\source\main.cpp(19) : error C2065: '_mangled_main' : undeclared identifier
    Last edited by St0rmTroop3er; 03-09-2006 at 01:58 AM.

  2. #2
    Registered User
    Join Date
    Feb 2006
    Posts
    65
    > ~AminaRPGEngine():

    You wrote a colon there, it should be a semi-colon.

  3. #3
    using namespace Trooper; St0rmTroop3er's Avatar
    Join Date
    Sep 2003
    Posts
    77
    Silly me, thanks!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Strings Program
    By limergal in forum C++ Programming
    Replies: 4
    Last Post: 12-02-2006, 03:24 PM
  2. Programming using strings
    By jlu0418 in forum C++ Programming
    Replies: 5
    Last Post: 11-26-2006, 08:07 PM
  3. Reading strings input by the user...
    By Cmuppet in forum C Programming
    Replies: 13
    Last Post: 07-21-2004, 07:37 AM
  4. damn strings
    By jmzl666 in forum C Programming
    Replies: 10
    Last Post: 06-24-2002, 03:09 AM
  5. menus and strings
    By garycastillo in forum C Programming
    Replies: 3
    Last Post: 04-29-2002, 12:23 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21