GIDForums  

Go Back   GIDForums > Computer Programming Forums > MS Visual C++ / MFC Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 09-May-2005, 08:59
pointer pointer is offline
Junior Member
 
Join Date: Apr 2005
Posts: 30
pointer is on a distinguished road

C++ Compiling Error


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:

CPP / C++ / C Code:
#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)


Anybosy can tell me what's the problem??
Last edited by LuciWiz : 09-May-2005 at 13:38. Reason: Please include your C code between [c] & [/c] tags
  #2  
Old 09-May-2005, 09:23
pointer pointer is offline
Junior Member
 
Join Date: Apr 2005
Posts: 30
pointer is on a distinguished road
I fixed the error. I have worked in C environment this long. So mistakenly I include <stdio.h> hearder file instead of <iostream.h>. Thanks for your try.
  #3  
Old 09-May-2005, 14:39
rdrast rdrast is offline
New Member
 
Join Date: Apr 2005
Posts: 22
rdrast is on a distinguished road
<iostream.h> is deprecated, and shouldn't be used anymore in new programs.

Use the standard <iostream> instead.
  #4  
Old 12-May-2005, 04:08
aie0 aie0 is offline
Member
 
Join Date: Dec 2004
Posts: 246
aie0 is a jewel in the roughaie0 is a jewel in the rough
In future use c++ forum and not mfc one
 
 

Recent GIDBlogVista ?Widgets? on Windows XP by LocalTech

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Tutorial] GUI programming with FLTK dsmith FLTK Forum 10 03-Oct-2005 15:41
What is "Ambigious symbol" ??*( a compilation error) small_ticket C++ Forum 2 07-Jan-2005 21:10
Error C2146: syntax error : missing ',' before identifier 'C4' mattchew008 C++ Forum 2 19-Dec-2004 06:06
Can enum have same name as class? crystalattice C++ Forum 3 08-Dec-2004 16:43
OpenGL always reports error mvt OpenGL Programming 2 04-Jun-2004 06:42

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 20:31.


vBulletin, Copyright © 2000 - 2010, Jelsoft Enterprises Ltd.