View Single Post
Old 05-09-2005, 10:56 AM   #1 (permalink)
Mohan Giri
 
True Techie

Join Date: Dec 2004

Posts: 145

Mohan Giri

Default C++ Compiling Error

Hello everyone,
I have compiled my first c++ program in Windows environment. (MS VC++). But I am getting error for the simple program.

My program is:

#include<stdio.h>
main()
{
cout<<"Welcome to C++";
cout<<"All the best";
}


Error is

--------------------Configuration: first - Win32 Debug--------------------
Compiling...
hello1.cpp
e:\giri\c++\ex\first\hello1.cpp(4) : error C2065: 'cout' : undeclared identifier
e:\giri\c++\ex\first\hello1.cpp(4) : error C2297: '<<' : illegal, right operand has type 'char [10]'
e:\giri\c++\ex\first\hello1.cpp(5) : warning C4508: 'main' : function should return a value; 'void' return type assumed
Error executing cl.exe.

hello1.obj - 2 error(s), 1 warning(s)


Can anybody tell me what is the problem.
Mohan Giri is offline