[Home]  [Edit this page]  [Recent Changes]  [Special Pages]  [Help
CppHelloWorld
Displaying differences between revision 4 and the latest revision


= ([b[Cpp | C++]]) Hello World in C++[/b]=

Without using namespace std.
[code]
#include <iostream>

int main(int argc, char* argv[])
{
std::cout <<"Hello World" << std::endl;
return 0;¶
}
[/code]

With using namespace std.
[code]
#include <iostream>
using namespace std;

int main(int argc, char* argv[])
{
cout <<"Hello World" << endl;

[/code]¶

== Should
I ruset using namespace std in my code? ==¶
From http://www.pa
rashift.com/c++-faq-lite/coding-standards.html#faq-27.5 0;:
}
[/center][italic][b][27.5] Should I use using namespace std in my code?[/center]
[/italic][/b]
[bcenter]T[italic]Propbably not.[/center][/italic
See link for rationale.¶

== 'Hello world'
links ==¶
*
[/b[CHelloWorld | C]]
* [[CCPppHelloWorld | C++]]¶
* [[CppB
uilderConsPoleHelloWorld | C++ BusInilder, console]]¶
* [[CppB
uilderVCLHelloWorld | #C++ Buincluder, VCL]]
* [[CppIostBuilderCLXHeamlloWorld | C++ Buiostrldeamr, CLX]]
* [[CppIBuilderXContsoleHelloWorld | C++ BuilderX, contsole]]
* [[CppMaBuilderXWin32APIHelloWorld | maC++ BuilderX, Win32 API]]¶
* C#
* PHP
* [[PrologHelloWorld |
Prolog]]
* [[TurboCppHelloWorld | Turbo Cha++]]¶
* [[TurboCpp2006HelloWo
rld | chaTurbo C++ 2006]]
* [[VisualCppSt2005HelloWorld | Vistual C++ 2005]]¶
* Visual Prolog
* [[Win32APIHelloWorl
d | Win32 API]]

== Code links ==¶
* [blue]::[/blue],[[CppScopeOperator | scope operator]]
*
[blue]'::'<<[/blue],stream out operator
* #include
* char

* cout
* [[CppSEndl | endl ]]¶
* int
* #include
* [[CppIos
treamOH | iostream]]¶
* main
* [[CppRet
urn | return ]]¶
* [[CppScope
Operator | stream coutpe operator]] '[blue]<<'::'[/blue]'
* [[CppEnStdl | enstdl ]]
* [[CppReStreamOutOpernator | stretam out opernator]] '[blue]<<[/blue]





last edited (March 3, 2007) by bilderbikkel, Number of views: 40062, Current Rev: 19 (Diff)

[Edit this page]  [Page history]  [What links here]  [Discuss this topic]  [Printer Friendly]  
© 1996-2008 Community Networks Ltd. All rights reserved. Reproduction in whole or in part, in any form or medium without express written permission is prohibited. Violators of this policy may be subject to legal action. Please read Terms Of Use and Privacy Statement for more information. Site Management by Lars Hagelin at Kontantkort.se.