using namespace std; is best illustrated with an example
#include <iostream> // The 'new' way of including iostream
int main(int argc, char** argv)
{
using namespace std;
cout << "Hello World"; // output text to screen
return 0;
}
WITHOUT using namespace std; we must type
std::cout << "Hello World";
because we want to use the standard 'cout', not our own version.
If we have a lot of 'cout's to type, we can use using namespace std; to
avoid typing std:: all the time.
Daniel
>From: Roberto Ricardi <rob...@ar...>
>To: 'Dev-C++ -Users-List' <dev...@li...>
>Subject: [Dev-C++] Lost with 4.9.7.x and ... headers and using name std;
>Date: Thu, 20 Mar 2003 00:44:12 -0300
>
>Hi all,
>
>Im lost with Dev-C++ 4.9.7.x and ... compiler or linker ? results
>
>I had work well lately using:
>
>#include <stdio.h>
>#include <stdlib.h>
>#include <string.h>
>#include <time.h>
>#include <conio.h>
>#include <dos.h>
>#include <math.h>
>#include <windows.h>
>#include <cstdlib.h>
>#include <iostream.h>
>
>With new one versions Dev-C++ / mingw mean 4.9.7.4 and forward
>Start figthed with:
>
>/*#include <cstdlib.h>*/
>#include <cstdlib>
>/*#include <iostream.h>*/
>#include <iostream>
>
>using namespace std;
>
>all the time compiler told me:
>
>no such file or directory or some like [Linker error] undefined reference
>to `__gxx_personality_v0'
>
>What mean "using namespace std;" ??
>
>Sorry, I dont work with c++ mean just c
>
>Need I reinstall a old version again and forget ?. Please give me some
>ideas about.
>
>Thanks in advance
>
>Roberto
>
>
>
>
>
>-------------------------------------------------------
>This SF.net email is sponsored by: Does your code think in ink? You could
>win a Tablet PC. Get a free Tablet PC hat just for playing. What are you
>waiting for?
>http://ads.sourceforge.net/cgi-bin/redirect.pl?micr5043en
>_______________________________________________
>Dev-cpp-users mailing list
>Dev...@li...
>TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm
>https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
_________________________________________________________________
Chat online in real time with MSN Messenger http://messenger.msn.co.uk
|