Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Whats wrong with this code?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
AndrewMan
Grandmaster Cheater Supreme
Reputation: 0

Joined: 01 Aug 2007
Posts: 1257

PostPosted: Thu Jul 09, 2009 11:55 pm    Post subject: Whats wrong with this code? Reply with quote

I get ALL these errors when I run this code. I am using MS Visual C++

Code:
// myfirst.cpp-- How to Display a message

#include <iostream> // a PREPROCESSOR directive
int main() // function header
{ // start of function body
using namespace std; // make definitions visible
cout << “Come up and C++ me some time.”; // message
cout << endl; // start a new line
cout << “You won’t regret it!” << endl; // more output
return 0; // terminate main()
} // end of function body



09\firstproject july 10, 2009\myfirst.cpp(7) : error C2065: '“Come' : undeclared identifier
1>c:\users\andrew\documents\visual studio 2008\projects\firstproject july 10, 2009\firstproject july 10, 2009\myfirst.cpp(7) : error C2146: syntax error : missing ';' before identifier 'up'
1>c:\users\andrew\documents\visual studio 2008\projects\firstproject july 10, 2009\firstproject july 10, 2009\myfirst.cpp(7) : error C2065: 'up' : undeclared identifier
1>c:\users\andrew\documents\visual studio 2008\projects\firstproject july 10, 2009\firstproject july 10, 2009\myfirst.cpp(7) : error C2146: syntax error : missing ';' before identifier 'and'
1>c:\users\andrew\documents\visual studio 2008\projects\firstproject july 10, 2009\firstproject july 10, 2009\myfirst.cpp(7) : error C2065: 'and' : undeclared identifier
1>c:\users\andrew\documents\visual studio 2008\projects\firstproject july 10, 2009\firstproject july 10, 2009\myfirst.cpp(7) : error C2146: syntax error : missing ';' before identifier 'C'
1>c:\users\andrew\documents\visual studio 2008\projects\firstproject july 10, 2009\firstproject july 10, 2009\myfirst.cpp(7) : error C2065: 'C' : undeclared identifier
1>c:\users\andrew\documents\visual studio 2008\projects\firstproject july 10, 2009\firstproject july 10, 2009\myfirst.cpp(7) : error C2146: syntax error : missing ';' before identifier 'me'
1>c:\users\andrew\documents\visual studio 2008\projects\firstproject july 10, 2009\firstproject july 10, 2009\myfirst.cpp(7) : error C2065: 'me' : undeclared identifier
1>c:\users\andrew\documents\visual studio 2008\projects\firstproject july 10, 2009\firstproject july 10, 2009\myfirst.cpp(7) : error C2146: syntax error : missing ';' before identifier 'some'
1>c:\users\andrew\documents\visual studio 2008\projects\firstproject july 10, 2009\firstproject july 10, 2009\myfirst.cpp(7) : error C2065: 'some' : undeclared identifier
1>c:\users\andrew\documents\visual studio 2008\projects\firstproject july 10, 2009\firstproject july 10, 2009\myfirst.cpp(7) : error C2146: syntax error : missing ';' before identifier 'time'
1>c:\users\andrew\documents\visual studio 2008\projects\firstproject july 10, 2009\firstproject july 10, 2009\myfirst.cpp(7) : error C2065: 'time' : undeclared identifier
1>c:\users\andrew\documents\visual studio 2008\projects\firstproject july 10, 2009\firstproject july 10, 2009\myfirst.cpp(7) : error C2228: left of '.”' must have class/struct/union
1> type is ''unknown-type''
1>c:\users\andrew\documents\visual studio 2008\projects\firstproject july 10, 2009\firstproject july 10, 2009\myfirst.cpp(9) : error C2065: '“You' : undeclared identifier
1>c:\users\andrew\documents\visual studio 2008\projects\firstproject july 10, 2009\firstproject july 10, 2009\myfirst.cpp(9) : error C2146: syntax error : missing ';' before identifier 'won’t'
1>c:\users\andrew\documents\visual studio 2008\projects\firstproject july 10, 2009\firstproject july 10, 2009\myfirst.cpp(9) : error C2065: 'won’t' : undeclared identifier
1>c:\users\andrew\documents\visual studio 2008\projects\firstproject july 10, 2009\firstproject july 10, 2009\myfirst.cpp(9) : error C2146: syntax error : missing ';' before identifier 'regret'
1>c:\users\andrew\documents\visual studio 2008\projects\firstproject july 10, 2009\firstproject july 10, 2009\myfirst.cpp(9) : error C2065: 'regret' : undeclared identifier
1>c:\users\andrew\documents\visual studio 2008\projects\firstproject july 10, 2009\firstproject july 10, 2009\myfirst.cpp(9) : error C2146: syntax error : missing ';' before identifier 'it'
1>c:\users\andrew\documents\visual studio 2008\projects\firstproject july 10, 2009\firstproject july 10, 2009\myfirst.cpp(9) : error C2065: 'it' : undeclared identifier
1>c:\users\andrew\documents\visual studio 2008\projects\firstproject july 10, 2009\firstproject july 10, 2009\myfirst.cpp(9) : error C2143: syntax error : missing ';' before '!'
1>c:\users\andrew\documents\visual studio 2008\projects\firstproject july 10, 2009\firstproject july 10, 2009\myfirst.cpp(9) : error C2563: mismatch in formal parameter list
1>c:\users\andrew\documents\visual studio 2008\projects\firstproject july 10, 2009\firstproject july 10, 2009\myfirst.cpp(9) : error C2568: '<<' : unable to resolve function overload
1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\ostream(974): could be 'std::basic_ostream<_Elem,_Traits> &std::endl(std::basic_ostream<_Elem,_Traits> &)'
1> with
1> [
1> _Elem=wchar_t,
1> _Traits=std::char_traits<wchar_t>
1> ]
1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\ostream(966): or 'std::basic_ostream<_Elem,_Traits> &std::endl(std::basic_ostream<_Elem,_Traits> &)'
1> with
1> [
1> _Elem=char,
1> _Traits=std::char_traits<char>
1> ]
1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\ostream(940): or 'std::basic_ostream<_Elem,_Traits> &std::endl(std::basic_ostream<_Elem,_Traits> &)'

_________________
Back to top
View user's profile Send private message
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Fri Jul 10, 2009 12:19 am    Post subject: Reply with quote

the quotation marks are fucked up.

rewrite them. "..."

Quote:
#include <iostream>
using namespace std;

int main()
{
cout << "Come up and C++ me some time.";
cout << endl;
cout << "You won’t regret it!" << endl;
return 0;
}
Back to top
View user's profile Send private message
AndrewMan
Grandmaster Cheater Supreme
Reputation: 0

Joined: 01 Aug 2007
Posts: 1257

PostPosted: Fri Jul 10, 2009 12:47 am    Post subject: Reply with quote

slovach wrote:
the quotation marks are fucked up.

rewrite them. "..."

Quote:
#include <iostream>
using namespace std;

int main()
{
cout << "Come up and C++ me some time.";
cout << endl;
cout << "You won’t regret it!" << endl;
return 0;
}


Bleh, yeah, now it works fine. Thanks Very Happy

I also get this error on the 3rd cout line:
-function call missing argument list
-unable to resolve function overload

Hmm...

_________________
Back to top
View user's profile Send private message
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Fri Jul 10, 2009 1:16 am    Post subject: Reply with quote

From that code?

What compiler are you using?
Back to top
View user's profile Send private message
AndrewMan
Grandmaster Cheater Supreme
Reputation: 0

Joined: 01 Aug 2007
Posts: 1257

PostPosted: Fri Jul 10, 2009 2:27 am    Post subject: Reply with quote

slovach wrote:
From that code?

What compiler are you using?


From this code:
Code:
cout << "You won’t regret it!" << endl;


and i'm using MS Visual C++

_________________
Back to top
View user's profile Send private message
NothingToShow
Grandmaster Cheater Supreme
Reputation: 0

Joined: 11 Jul 2007
Posts: 1579

PostPosted: Fri Jul 10, 2009 2:38 am    Post subject: Reply with quote

Try removing the "'" in "won't". I don't know if that is the problem, but it can be sometimes.
Back to top
View user's profile Send private message
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Fri Jul 10, 2009 3:03 am    Post subject: Reply with quote

Does this compile?

http://www.mediafire.com/download.php?n2vmyogzl5l


I had no trouble and I can't see why you are with that.
Back to top
View user's profile Send private message
AndrewMan
Grandmaster Cheater Supreme
Reputation: 0

Joined: 01 Aug 2007
Posts: 1257

PostPosted: Fri Jul 10, 2009 3:06 am    Post subject: Reply with quote

slovach wrote:
Does this compile?

http://www.mediafire.com/download.php?n2vmyogzl5l


I had no trouble and I can't see why you are with that.


Yep, that compiled fine. What'd you change?

Was it the "'" in won't?

Edit: I tried compiling it again and it worked. I wonder why it wasn't working before Rolling Eyes

_________________
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites