Click here to Skip to main content
16,006,065 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Access key Pin
Anthony_Yio31-May-04 0:51
Anthony_Yio31-May-04 0:51 
GeneralRe: Access key Pin
JR Shih31-May-04 2:25
JR Shih31-May-04 2:25 
Generalsending messages to the main window Pin
kfaday30-May-04 14:32
kfaday30-May-04 14:32 
GeneralRe: sending messages to the main window Pin
Ryan Binns30-May-04 18:07
Ryan Binns30-May-04 18:07 
GeneralRe: sending messages to the main window Pin
kfaday31-May-04 2:49
kfaday31-May-04 2:49 
GeneralRe: sending messages to the main window Pin
Anthony_Yio31-May-04 0:59
Anthony_Yio31-May-04 0:59 
GeneralRe: sending messages to the main window Pin
kfaday31-May-04 2:50
kfaday31-May-04 2:50 
Generalerror C2065: 'cout' : undeclared identifier Pin
Anonymous30-May-04 13:43
Anonymous30-May-04 13:43 
Hey,

I am tring to teach my self C++ from a book. And it is not going as well as i planned. I am tring to make the first program in the book and I keep getting the same error. I am using Visual C++ 6 as my compiler. The Program is very simple (Not for me i guess haha):

// myfirst.cpp--displays a message

#include "stdafx.h" // a PREPROCESSOR directive // make definitions visible
int main() // function heading
{ // start of function body
cout << "Come up and C++ me some time."; // message
cout << "\n"; // start a new line
return 0; // terminate main()
} // end of function body


The Error I always get is:

myfirst.cpp

c:\Documents and Settings\Ben Quinn\My Documents\Visual Studio Projects\myfirst\myfirst.cpp(6) : error C2065: 'cout' : undeclared identifier

c:\Documents and Settings\Ben Quinn\My Documents\Visual Studio Projects\myfirst\myfirst.cpp(7) : error C3861: 'cout': identifier not found, even with argument-dependent lookup


I am using the 32bit App Option like the book said to use. there is one difference between mine and the book's code. Their's code says:

#include <iostream>
using namespace std;


But whenever I use that I get the Error:

Compiling...
myfirst.cpp
c:\Documents and Settings\Ben Quinn\My Documents\Visual Studio Projects\myfirst\myfirst.cpp(12) : fatal error C1010: unexpected end of file while looking for precompiled header directive


I hope some one can help me out. I really wana get past the first 3 pages.

Thx

- Hidden
GeneralRe: error C2065: 'cout' : undeclared identifier Pin
kfaday30-May-04 14:37
kfaday30-May-04 14:37 
GeneralRe: error C2065: 'cout' : undeclared identifier Pin
Michael Dunn30-May-04 16:25
sitebuilderMichael Dunn30-May-04 16:25 
Generalform background bitmap Pin
zubeido30-May-04 13:41
zubeido30-May-04 13:41 
GeneralRe: form background bitmap Pin
Michael Dunn30-May-04 16:27
sitebuilderMichael Dunn30-May-04 16:27 
GeneralRe: form background bitmap Pin
Aizaz31-May-04 2:14
Aizaz31-May-04 2:14 
Generalfunny working ListBox - help! Pin
Anonymous30-May-04 11:46
Anonymous30-May-04 11:46 
GeneralDeriving Edit Box Control Pin
Grahamfff30-May-04 11:11
Grahamfff30-May-04 11:11 
GeneralC++ Launches File Pin
vinniez_ok30-May-04 9:22
vinniez_ok30-May-04 9:22 
GeneralRe: C++ Launches File Pin
Ravi Bhavnani30-May-04 9:45
professionalRavi Bhavnani30-May-04 9:45 
GeneralRe: C++ Launches File Pin
Michael Dunn30-May-04 10:09
sitebuilderMichael Dunn30-May-04 10:09 
GeneralRe: C++ Launches File Pin
vinniez_ok30-May-04 13:04
vinniez_ok30-May-04 13:04 
GeneralRe: C++ Launches File Pin
Michael Dunn30-May-04 16:30
sitebuilderMichael Dunn30-May-04 16:30 
GeneralRe: C++ Launches File Pin
vinniez_ok30-May-04 17:14
vinniez_ok30-May-04 17:14 
GeneralPrinting A report in A database Pin
Youngranger30-May-04 8:30
Youngranger30-May-04 8:30 
Questionhow to get IDirectNotify Pin
laia30-May-04 8:08
laia30-May-04 8:08 
AnswerRe: how to get IDirectNotify Pin
Alexander M.,30-May-04 11:40
Alexander M.,30-May-04 11:40 
Generalthis is my method Pin
laia31-May-04 2:59
laia31-May-04 2:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.