I found a complete list of hello world functions, go now:
http://c2.com/cgi/wiki?HelloWorldInM...mmingLanguages
Printable View
I found a complete list of hello world functions, go now:
http://c2.com/cgi/wiki?HelloWorldInM...mmingLanguages
thats the most screwy version of C++ hello world I have ever seen.... Not only does it not spell world properly, but whats with all the std:: crap...Code:#include <iostream>
int main()
{
std::cout << "Hello, Ward." << std::endl;
}
Well, cout is in the std namespace (as is endl), so technically you should use std::cout when you want to send data to the standard output.
Edit: Went on the Wiki and corrected the spelling mistake for you souleman. ;)
I know its in means stdout, but who the hell actually programs like that?
Me. ;)
Yeah a lot of the diehard C++ programmers (*cough*pwaring*cough*) think that using
using namespace std;
completely destroys the purpose of having namespaces. I don't do it but If you want a page long explanation with charts, graphs, quotes, and a gif or two then ask pwaring all about it ;)
pwaring> if you want a language that requires you to type all sorts of crap before you can output a line use java..
System.out.println is a lot longer then cout
I use Java as well. ;)
I just think that you should be explicit wherever possible in any language - the only exception to this being Perl because it's good enough for one-liners.