GwynforWeb
asked on
cin and cout not working
I am using and old version of Visual C++ on one of our machines and am having trouble with cout and cin. If I run the following console app
#include "stdafx.h"
#include <iostream>
int main(){
cout <<"hello world";
return 0;
}
I get the errors
error C2065: 'cout' : undeclared identifier
error C2297: '<<' : illegal, right operand has type 'char [12]'
error C2059: syntax error : ';'
I am guessing that <iostream> is some how not getting included. If I use printf("hello world") all works fiine. Any ideas?
#include "stdafx.h"
#include <iostream>
int main(){
cout <<"hello world";
return 0;
}
I get the errors
error C2065: 'cout' : undeclared identifier
error C2297: '<<' : illegal, right operand has type 'char [12]'
error C2059: syntax error : ';'
I am guessing that <iostream> is some how not getting included. If I use printf("hello world") all works fiine. Any ideas?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Those won't work in older compilers like Turbo C++ :)
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
>>yep, I just noticed I had missed that :(. Here are the points anyway:-)
FYI:
You didn't award the points for this question.
The question is still open.
FYI:
You didn't award the points for this question.
The question is still open.
ASKER