Link to home
Start Free TrialLog in
Avatar of GwynforWeb
GwynforWebFlag for Canada

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?
ASKER CERTIFIED SOLUTION
Avatar of Harisha M G
Harisha M G
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of GwynforWeb

ASKER

yep, I just noticed I had missed that :(.   Here are the points anyway:-)
Those won't work in older compilers like Turbo C++ :)
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
>>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.