 |
Cheat Engine The Official Site of Cheat Engine
|
| View previous topic :: View next topic |
| Author |
Message |
Kamikaze Grandmaster Cheater Supreme
Reputation: 0
Joined: 03 Jul 2007 Posts: 1180 Location: The Lowlands.
|
Posted: Wed Jul 09, 2008 3:11 pm Post subject: [Question] Compiling in VC++ 2005 |
|
|
I tried to compile this:
| Code: | #include "stdafx.h"
#include <iostream>
void main()
{
//define variables
float num1;
float num2;
float total;
//Enter data for the variables
cout << "Enter a value for the first variable; ";
cin >> num1;
cout << "Enter a value for the second variable; ";
cin << num2;
//Add the two numbers together
total = num1 + num2;
//Display the result
cout << "The sum of the numbers = " << total << endl;
} |
Got these errors:
| Code: | 1>c:\documents and settings\shotta\my documents\visual studio 2005\projects\calculator\calculator\calculator.cpp(13) : error C2065: 'cout' : undeclared identifier
1>c:\documents and settings\shotta\my documents\visual studio 2005\projects\calculator\calculator\calculator.cpp(14) : error C2065: 'cin' : undeclared identifier
1>c:\documents and settings\shotta\my documents\visual studio 2005\projects\calculator\calculator\calculator.cpp(22) : error C2065: 'endl' : undeclared identifier |
I guess cin and cout and endl are old identifiers, but what are the new one? Because it should be a calculator. I made this with the video tutorial somewhere in the forum
_________________
|
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8588 Location: 127.0.0.1
|
Posted: Wed Jul 09, 2008 4:02 pm Post subject: |
|
|
You didn't include the namespace. If you don't use the namespace then you need to add std:: infront of cout, cin, and endl.
_________________
- Retired. |
|
| Back to top |
|
 |
Noz3001 I'm a spammer
Reputation: 26
Joined: 29 May 2006 Posts: 6220 Location: /dev/null
|
Posted: Wed Jul 09, 2008 4:03 pm Post subject: |
|
|
| Code: | using namespace std;
|
or
| Code: |
std::cout
std::cin
std::endl |
|
|
| Back to top |
|
 |
Kamikaze Grandmaster Cheater Supreme
Reputation: 0
Joined: 03 Jul 2007 Posts: 1180 Location: The Lowlands.
|
Posted: Wed Jul 09, 2008 4:19 pm Post subject: |
|
|
Thanks you very much, both of you
EDIT:
| Code: | 1>------ Build started: Project: Calculator, Configuration: Debug Win32 ------
1>Compiling...
1>Calculator.cpp
1>c:\documents and settings\shotta\my documents\visual studio 2005\projects\calculator\calculator\calculator.cpp(16) : error C2784: 'std::basic_ostream<char,_Traits> &std::operator <<(std::basic_ostream<char,_Traits> &,unsigned char)' : could not deduce template argument for 'std::basic_ostream<char,_Traits> &' from 'std::istream'
1> c:\program files\microsoft visual studio 8\vc\include\ostream(927) : see declaration of 'std::operator <<'
1>c:\documents and settings\shotta\my documents\visual studio 2005\projects\calculator\calculator\calculator.cpp(16) : error C2784: 'std::basic_ostream<char,_Traits> &std::operator <<(std::basic_ostream<char,_Traits> &,unsigned char)' : could not deduce template argument for 'std::basic_ostream<char,_Traits> &' from 'std::istream'
1> c:\program files\microsoft visual studio 8\vc\include\ostream(927) : see declaration of 'std::operator <<'
1>c:\documents and settings\shotta\my documents\visual studio 2005\projects\calculator\calculator\calculator.cpp(16) : error C2784: 'std::basic_ostream<char,_Traits> &std::operator <<(std::basic_ostream<char,_Traits> &,unsigned char)' : could not deduce template argument for 'std::basic_ostream<char,_Traits> &' from 'std::istream'
1> c:\program files\microsoft visual studio 8\vc\include\ostream(927) : see declaration of 'std::operator <<'
1>c:\documents and settings\shotta\my documents\visual studio 2005\projects\calculator\calculator\calculator.cpp(16) : error C2784: 'std::basic_ostream<char,_Traits> &std::operator <<(std::basic_ostream<char,_Traits> &,unsigned char)' : could not deduce template argument for 'std::basic_ostream<char,_Traits> &' from 'std::istream'
1> c:\program files\microsoft visual studio 8\vc\include\ostream(927) : see declaration of 'std::operator <<'
1>c:\documents and settings\shotta\my documents\visual studio 2005\projects\calculator\calculator\calculator.cpp(16) : error C2784: 'std::basic_ostream<char,_Traits> &std::operator <<(std::basic_ostream<char,_Traits> &,const unsigned char *)' : could not deduce template argument for 'std::basic_ostream<char,_Traits> &' from 'std::istream'
1> c:\program files\microsoft visual studio 8\vc\include\ostream(920) : see declaration of 'std::operator <<'
1>c:\documents and settings\shotta\my documents\visual studio 2005\projects\calculator\calculator\calculator.cpp(16) : error C2784: 'std::basic_ostream<char,_Traits> &std::operator <<(std::basic_ostream<char,_Traits> &,const unsigned char *)' : could not deduce template argument for 'std::basic_ostream<char,_Traits> &' from 'std::istream'
1> c:\program files\microsoft visual studio 8\vc\include\ostream(920) : see declaration of 'std::operator <<'
1>c:\documents and settings\shotta\my documents\visual studio 2005\projects\calculator\calculator\calculator.cpp(16) : error C2784: 'std::basic_ostream<char,_Traits> &std::operator <<(std::basic_ostream<char,_Traits> &,const unsigned char *)' : could not deduce template argument for 'std::basic_ostream<char,_Traits> &' from 'std::istream'
1> c:\program files\microsoft visual studio 8\vc\include\ostream(920) : see declaration of 'std::operator <<'
1>c:\documents and settings\shotta\my documents\visual studio 2005\projects\calculator\calculator\calculator.cpp(16) : error C2784: 'std::basic_ostream<char,_Traits> &std::operator <<(std::basic_ostream<char,_Traits> &,const unsigned char *)' : could not deduce template argument for 'std::basic_ostream<char,_Traits> &' from 'std::istream'
1> c:\program files\microsoft visual studio 8\vc\include\ostream(920) : see declaration of 'std::operator <<'
1>c:\documents and settings\shotta\my documents\visual studio 2005\projects\calculator\calculator\calculator.cpp(16) : error C2784: 'std::basic_ostream<char,_Traits> &std::operator <<(std::basic_ostream<char,_Traits> &,signed char)' : could not deduce template argument for 'std::basic_ostream<char,_Traits> &' from 'std::istream'
1> c:\program files\microsoft visual studio 8\vc\include\ostream(913) : see declaration of 'std::operator <<'
1>c:\documents and settings\shotta\my documents\visual studio 2005\projects\calculator\calculator\calculator.cpp(16) : error C2784: 'std::basic_ostream<char,_Traits> &std::operator <<(std::basic_ostream<char,_Traits> &,signed char)' : could not deduce template argument for 'std::basic_ostream<char,_Traits> &' from 'std::istream'
1> c:\program files\microsoft visual studio 8\vc\include\ostream(913) : see declaration of 'std::operator <<'
1>c:\documents and settings\shotta\my documents\visual studio 2005\projects\calculator\calculator\calculator.cpp(16) : error C2784: 'std::basic_ostream<char,_Traits> &std::operator <<(std::basic_ostream<char,_Traits> &,signed char)' : could not deduce template argument for 'std::basic_ostream<char,_Traits> &' from 'std::istream'
1> c:\program files\microsoft visual studio 8\vc\include\ostream(913) : see declaration of 'std::operator <<'
1>c:\documents and settings\shotta\my documents\visual studio 2005\projects\calculator\calculator\calculator.cpp(16) : error C2784: 'std::basic_ostream<char,_Traits> &std::operator <<(std::basic_ostream<char,_Traits> &,signed char)' : could not deduce template argument for 'std::basic_ostream<char,_Traits> &' from 'std::istream'
1> c:\program files\microsoft visual studio 8\vc\include\ostream(913) : see declaration of 'std::operator <<'
1>c:\documents and settings\shotta\my documents\visual studio 2005\projects\calculator\calculator\calculator.cpp(16) : error C2784: 'std::basic_ostream<char,_Traits> &std::operator <<(std::basic_ostream<char,_Traits> &,const signed char *)' : could not deduce template argument for 'std::basic_ostream<char,_Traits> &' from 'std::istream'
1> c:\program files\microsoft visual studio 8\vc\include\ostream(906) : see declaration of 'std::operator <<'
1>c:\documents and settings\shotta\my documents\visual studio 2005\projects\calculator\calculator\calculator.cpp(16) : error C2784: 'std::basic_ostream<char,_Traits> &std::operator <<(std::basic_ostream<char,_Traits> &,const signed char *)' : could not deduce template argument for 'std::basic_ostream<char,_Traits> &' from 'std::istream'
1> c:\program files\microsoft visual studio 8\vc\include\ostream(906) : see declaration of 'std::operator <<'
1>c:\documents and settings\shotta\my documents\visual studio 2005\projects\calculator\calculator\calculator.cpp(16) : error C2784: 'std::basic_ostream<char,_Traits> &std::operator <<(std::basic_ostream<char,_Traits> &,const signed char *)' : could not deduce template argument for 'std::basic_ostream<char,_Traits> &' from 'std::istream'
1> c:\program files\microsoft visual studio 8\vc\include\ostream(906) : see declaration of 'std::operator <<'
1>c:\documents and settings\shotta\my documents\visual studio 2005\projects\calculator\calculator\calculator.cpp(16) : error C2784: 'std::basic_ostream<char,_Traits> &std::operator <<(std::basic_ostream<char,_Traits> &,const signed char *)' : could not deduce template argument for 'std::basic_ostream<char,_Traits> &' from 'std::istream'
1> c:\program files\microsoft visual studio 8\vc\include\ostream(906) : see declaration of 'std::operator <<'
1>c:\documents and settings\shotta\my documents\visual studio 2005\projects\calculator\calculator\calculator.cpp(16) : error C2784: 'std::basic_ostream<_Elem,_Traits> &std::operator <<(std::basic_ostream<_Elem,_Traits> &,_Elem)' : could not deduce template argument for 'std::basic_ostream<_Elem,_Traits> &' from 'std::istream'
1> c:\program files\microsoft visual studio 8\vc\include\ostream(868) : see declaration of 'std::operator <<'
1>c:\documents and settings\shotta\my documents\visual studio 2005\projects\calculator\calculator\calculator.cpp(16) : error C2784: 'std::basic_ostream<_Elem,_Traits> &std::operator <<(std::basic_ostream<_Elem,_Traits> &,_Elem)' : could not deduce template argument for 'std::basic_ostream<_Elem,_Traits> &' from 'std::istream'
1> c:\program files\microsoft visual studio 8\vc\include\ostream(868) : see declaration of 'std::operator <<'
1>c:\documents and settings\shotta\my documents\visual studio 2005\projects\calculator\calculator\calculator.cpp(16) : error C2784: 'std::basic_ostream<_Elem,_Traits> &std::operator <<(std::basic_ostream<_Elem,_Traits> &,_Elem)' : could not deduce template argument for 'std::basic_ostream<_Elem,_Traits> &' from 'std::istream'
1> c:\program files\microsoft visual studio 8\vc\include\ostream(868) : see declaration of 'std::operator <<'
1>c:\documents and settings\shotta\my documents\visual studio 2005\projects\calculator\calculator\calculator.cpp(16) : error C2784: 'std::basic_ostream<_Elem,_Traits> &std::operator <<(std::basic_ostream<_Elem,_Traits> &,_Elem)' : could not deduce template argument for 'std::basic_ostream<_Elem,_Traits> &' from 'std::istream'
1> c:\program files\microsoft visual studio 8\vc\include\ostream(868) : see declaration of 'std::operator <<'
1>c:\documents and settings\shotta\my documents\visual studio 2005\projects\calculator\calculator\calculator.cpp(16) : error C2784: 'std::basic_ostream<_Elem,_Traits> &std::operator <<(std::basic_ostream<_Elem,_Traits> &,const _Elem *)' : could not deduce template argument for 'std::basic_ostream<_Elem,_Traits> &' from 'std::istream'
1> c:\program files\microsoft visual studio 8\vc\include\ostream(822) : see declaration of 'std::operator <<'
1>c:\documents and settings\shotta\my documents\visual studio 2005\projects\calculator\calculator\calculator.cpp(16) : error C2784: 'std::basic_ostream<_Elem,_Traits> &std::operator <<(std::basic_ostream<_Elem,_Traits> &,const _Elem *)' : could not deduce template argument for 'std::basic_ostream<_Elem,_Traits> &' from 'std::istream'
1> c:\program files\microsoft visual studio 8\vc\include\ostream(822) : see declaration of 'std::operator <<'
1>c:\documents and settings\shotta\my documents\visual studio 2005\projects\calculator\calculator\calculator.cpp(16) : error C2784: 'std::basic_ostream<_Elem,_Traits> &std::operator <<(std::basic_ostream<_Elem,_Traits> &,const _Elem *)' : could not deduce template argument for 'std::basic_ostream<_Elem,_Traits> &' from 'std::istream'
1> c:\program files\microsoft visual studio 8\vc\include\ostream(822) : see declaration of 'std::operator <<'
1>c:\documents and settings\shotta\my documents\visual studio 2005\projects\calculator\calculator\calculator.cpp(16) : error C2784: 'std::basic_ostream<_Elem,_Traits> &std::operator <<(std::basic_ostream<_Elem,_Traits> &,const _Elem *)' : could not deduce template argument for 'std::basic_ostream<_Elem,_Traits> &' from 'std::istream'
1> c:\program files\microsoft visual studio 8\vc\include\ostream(822) : see declaration of 'std::operator <<'
1>c:\documents and settings\shotta\my documents\visual studio 2005\projects\calculator\calculator\calculator.cpp(16) : error C2784: 'std::basic_ostream<char,_Traits> &std::operator <<(std::basic_ostream<char,_Traits> &,char)' : could not deduce template argument for 'std::basic_ostream<char,_Traits> &' from 'std::istream'
1> c:\program files\microsoft visual studio 8\vc\include\ostream(782) : see declaration of 'std::operator <<'
1>c:\documents and settings\shotta\my documents\visual studio 2005\projects\calculator\calculator\calculator.cpp(16) : error C2784: 'std::basic_ostream<char,_Traits> &std::operator <<(std::basic_ostream<char,_Traits> &,char)' : could not deduce template argument for 'std::basic_ostream<char,_Traits> &' from 'std::istream'
1> c:\program files\microsoft visual studio 8\vc\include\ostream(782) : see declaration of 'std::operator <<'
1>c:\documents and settings\shotta\my documents\visual studio 2005\projects\calculator\calculator\calculator.cpp(16) : error C2784: 'std::basic_ostream<char,_Traits> &std::operator <<(std::basic_ostream<char,_Traits> &,char)' : could not deduce template argument for 'std::basic_ostream<char,_Traits> &' from 'std::istream'
1> c:\program files\microsoft visual studio 8\vc\include\ostream(782) : see declaration of 'std::operator <<'
1>c:\documents and settings\shotta\my documents\visual studio 2005\projects\calculator\calculator\calculator.cpp(16) : error C2784: 'std::basic_ostream<char,_Traits> &std::operator <<(std::basic_ostream<char,_Traits> &,char)' : could not deduce template argument for 'std::basic_ostream<char,_Traits> &' from 'std::istream'
1> c:\program files\microsoft visual studio 8\vc\include\ostream(782) : see declaration of 'std::operator <<'
1>c:\documents and settings\shotta\my documents\visual studio 2005\projects\calculator\calculator\calculator.cpp(16) : error C2784: 'std::basic_ostream<char,_Traits> &std::operator <<(std::basic_ostream<char,_Traits> &,const char *)' : could not deduce template argument for 'std::basic_ostream<char,_Traits> &' from 'std::istream'
1> c:\program files\microsoft visual studio 8\vc\include\ostream(735) : see declaration of 'std::operator <<'
1>c:\documents and settings\shotta\my documents\visual studio 2005\projects\calculator\calculator\calculator.cpp(16) : error C2784: 'std::basic_ostream<char,_Traits> &std::operator <<(std::basic_ostream<char,_Traits> &,const char *)' : could not deduce template argument for 'std::basic_ostream<char,_Traits> &' from 'std::istream'
1> c:\program files\microsoft visual studio 8\vc\include\ostream(735) : see declaration of 'std::operator <<'
1>c:\documents and settings\shotta\my documents\visual studio 2005\projects\calculator\calculator\calculator.cpp(16) : error C2784: 'std::basic_ostream<char,_Traits> &std::operator <<(std::basic_ostream<char,_Traits> &,const char *)' : could not deduce template argument for 'std::basic_ostream<char,_Traits> &' from 'std::istream'
1> c:\program files\microsoft visual studio 8\vc\include\ostream(735) : see declaration of 'std::operator <<'
1>c:\documents and settings\shotta\my documents\visual studio 2005\projects\calculator\calculator\calculator.cpp(16) : error C2784: 'std::basic_ostream<char,_Traits> &std::operator <<(std::basic_ostream<char,_Traits> &,const char *)' : could not deduce template argument for 'std::basic_ostream<char,_Traits> &' from 'std::istream'
1> c:\program files\microsoft visual studio 8\vc\include\ostream(735) : see declaration of 'std::operator <<'
1>c:\documents and settings\shotta\my documents\visual studio 2005\projects\calculator\calculator\calculator.cpp(16) : error C2784: 'std::basic_ostream<_Elem,_Traits> &std::operator <<(std::basic_ostream<_Elem,_Traits> &,char)' : could not deduce template argument for 'std::basic_ostream<_Elem,_Traits> &' from 'std::istream'
1> c:\program files\microsoft visual studio 8\vc\include\ostream(697) : see declaration of 'std::operator <<'
1>c:\documents and settings\shotta\my documents\visual studio 2005\projects\calculator\calculator\calculator.cpp(16) : error C2784: 'std::basic_ostream<_Elem,_Traits> &std::operator <<(std::basic_ostream<_Elem,_Traits> &,char)' : could not deduce template argument for 'std::basic_ostream<_Elem,_Traits> &' from 'std::istream'
1> c:\program files\microsoft visual studio 8\vc\include\ostream(697) : see declaration of 'std::operator <<'
1>c:\documents and settings\shotta\my documents\visual studio 2005\projects\calculator\calculator\calculator.cpp(16) : error C2784: 'std::basic_ostream<_Elem,_Traits> &std::operator <<(std::basic_ostream<_Elem,_Traits> &,char)' : could not deduce template argument for 'std::basic_ostream<_Elem,_Traits> &' from 'std::istream'
1> c:\program files\microsoft visual studio 8\vc\include\ostream(697) : see declaration of 'std::operator <<'
1>c:\documents and settings\shotta\my documents\visual studio 2005\projects\calculator\calculator\calculator.cpp(16) : error C2784: 'std::basic_ostream<_Elem,_Traits> &std::operator <<(std::basic_ostream<_Elem,_Traits> &,char)' : could not deduce template argument for 'std::basic_ostream<_Elem,_Traits> &' from 'std::istream'
1> c:\program files\microsoft visual studio 8\vc\include\ostream(697) : see declaration of 'std::operator <<'
1>c:\documents and settings\shotta\my documents\visual studio 2005\projects\calculator\calculator\calculator.cpp(16) : error C2784: 'std::basic_ostream<_Elem,_Traits> &std::operator <<(std::basic_ostream<_Elem,_Traits> &,const char *)' : could not deduce template argument for 'std::basic_ostream<_Elem,_Traits> &' from 'std::istream'
1> c:\program files\microsoft visual studio 8\vc\include\ostream(650) : see declaration of 'std::operator <<'
1>c:\documents and settings\shotta\my documents\visual studio 2005\projects\calculator\calculator\calculator.cpp(16) : error C2784: 'std::basic_ostream<_Elem,_Traits> &std::operator <<(std::basic_ostream<_Elem,_Traits> &,const char *)' : could not deduce template argument for 'std::basic_ostream<_Elem,_Traits> &' from 'std::istream'
1> c:\program files\microsoft visual studio 8\vc\include\ostream(650) : see declaration of 'std::operator <<'
1>c:\documents and settings\shotta\my documents\visual studio 2005\projects\calculator\calculator\calculator.cpp(16) : error C2784: 'std::basic_ostream<_Elem,_Traits> &std::operator <<(std::basic_ostream<_Elem,_Traits> &,const char *)' : could not deduce template argument for 'std::basic_ostream<_Elem,_Traits> &' from 'std::istream'
1> c:\program files\microsoft visual studio 8\vc\include\ostream(650) : see declaration of 'std::operator <<'
1>c:\documents and settings\shotta\my documents\visual studio 2005\projects\calculator\calculator\calculator.cpp(16) : error C2784: 'std::basic_ostream<_Elem,_Traits> &std::operator <<(std::basic_ostream<_Elem,_Traits> &,const char *)' : could not deduce template argument for 'std::basic_ostream<_Elem,_Traits> &' from 'std::istream'
1> c:\program files\microsoft visual studio 8\vc\include\ostream(650) : see declaration of 'std::operator <<'
1>c:\documents and settings\shotta\my documents\visual studio 2005\projects\calculator\calculator\calculator.cpp(16) : error C2676: binary '<<' : 'std::istream' does not define this operator or a conversion to a type acceptable to the predefined operator
1>c:\documents and settings\shotta\my documents\visual studio 2005\projects\calculator\calculator\calculator.cpp(22) : error C2065: 'endl' : undeclared identifier
1>Build log was saved at "file://c:\Documents and Settings\Shotta\My Documents\Visual Studio 2005\Projects\Calculator\Calculator\Debug\BuildLog.htm"
1>Calculator - 42 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== |
I am new to this all, and I don't know all these terms..
_________________
|
|
| 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
|
|