 |
Cheat Engine The Official Site of Cheat Engine
|
| View previous topic :: View next topic |
| Author |
Message |
AndrewMan Grandmaster Cheater Supreme
Reputation: 0
Joined: 01 Aug 2007 Posts: 1257
|
Posted: Thu Jul 09, 2009 11:55 pm Post subject: Whats wrong with this code? |
|
|
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 |
|
 |
hcavolsdsadgadsg I'm a spammer
Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
Posted: Fri Jul 10, 2009 12:19 am Post subject: |
|
|
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 |
|
 |
AndrewMan Grandmaster Cheater Supreme
Reputation: 0
Joined: 01 Aug 2007 Posts: 1257
|
Posted: Fri Jul 10, 2009 12:47 am Post subject: |
|
|
| 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
I also get this error on the 3rd cout line:
-function call missing argument list
-unable to resolve function overload
Hmm...
_________________
|
|
| Back to top |
|
 |
hcavolsdsadgadsg I'm a spammer
Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
Posted: Fri Jul 10, 2009 1:16 am Post subject: |
|
|
From that code?
What compiler are you using?
|
|
| Back to top |
|
 |
AndrewMan Grandmaster Cheater Supreme
Reputation: 0
Joined: 01 Aug 2007 Posts: 1257
|
Posted: Fri Jul 10, 2009 2:27 am Post subject: |
|
|
| 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 |
|
 |
NothingToShow Grandmaster Cheater Supreme
Reputation: 0
Joined: 11 Jul 2007 Posts: 1579
|
Posted: Fri Jul 10, 2009 2:38 am Post subject: |
|
|
| Try removing the "'" in "won't". I don't know if that is the problem, but it can be sometimes.
|
|
| Back to top |
|
 |
hcavolsdsadgadsg I'm a spammer
Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
|
| Back to top |
|
 |
AndrewMan Grandmaster Cheater Supreme
Reputation: 0
Joined: 01 Aug 2007 Posts: 1257
|
Posted: Fri Jul 10, 2009 3:06 am Post subject: |
|
|
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
_________________
|
|
| Back to top |
|
 |
|
|
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
|
|