www.delorie.com/archives/browse.cgi | search |
Message-ID: | <3f2bae8d$0$163$cc7c7865@news.luth.se> |
From: | Martin Str|mberg <ams AT speedy DOT ludd DOT luth DOT se> |
Subject: | Re: Undeclared (first use... |
Newsgroups: | comp.os.msdos.djgpp |
References: | <huNWa.2519$Y5 DOT 598 AT nntpserver DOT swip DOT net> |
User-Agent: | tin/1.4.6-20020816 ("Aerials") (UNIX) (NetBSD/1.6Q (alpha)) |
Date: | 02 Aug 2003 12:29:01 GMT |
Lines: | 36 |
NNTP-Posting-Host: | speedy.ludd.luth.se |
X-Trace: | 1059827341 news.luth.se 163 130.240.16.13 |
To: | djgpp AT delorie DOT com |
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp |
Reply-To: | djgpp AT delorie DOT com |
HELENA BROMAN <mirja DOT helena AT swipnet DOT se> wrote: : I've just started C++ and is not doing so fine... : I am trying the Hello World script: : #include <iostream.h> : int main() : { : cout << "Hello World!\n"; : return 0; : } You are coding in an obsolete version of C++. : and is compiling in djgpp : First I get an Backward varning for iostream.h so I remove the .h part and : gets this... : world.cpp: In function `int main()': : world.cpp:5 `cout' undeclared (first use this function) : Use what first? Whats wrong? The compiler tells you that the undeclared function/variable is used first in main(), just in case you would have more functions that also used that undeclared function/variable. You should get an up-to-date tutorial or book that teaches standard C++. If you do you will find you need to add "std::" in front of "cout". Right, MartinS
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |