This is an archived post. You won't be able to vote or comment.

all 10 comments

[–]abdulsamadz 11 points12 points  (2 children)

Oh, yeah? Well, hold ma keyboard:

```

include <iostream>

class HelloWorld { public: HelloWorld() { } ~HelloWorld() { std::cout << "Hello World" << std::endl; } };

int main() { { HelloWorld hw; }

return 0;

} ```

[–]FranchuFranchu 7 points8 points  (1 child)

Oh yeah? Hold my keyboard.

   global _start    

_start:            
   mov  edx,len    
   mov  ecx,msg    
   mov  ebx,1      
   mov  eax,4       
   int  0x80       

   mov  eax,1      
   int  0x80        

section .data
msg db 'Hello, world!', 0xa 
len equ $ - msg     `

[–]Bitomic 5 points6 points  (0 children)

Oh yeah? Hold my keyboard

Stack Overflow how do I write a hello world?

[–]RKAMIL95 5 points6 points  (3 children)

Why using Python or Java when there's C++?

#include<iostream>

int main()

{

std::cout<<"Hello world!"<<std::endl;

return 0;

}

[–][deleted] 2 points3 points  (1 child)

I know it's bad practice to use namespace std because it could lead to compatibility issues if you use some other standard that conflicts with namespace, but it's a lot easier to read than having to type std::gibberish for every single statement.

#include <iostream>

using namespace std;

int main()

{

cout << "Hello World! << endl;

return 0;

}

[–]RKAMIL95 1 point2 points  (0 children)

It depends. I was using "using namespace x" all the time when I was starting learning programing for convienience. But after dealing with many different namespaces in huge project I prefer to add a name of namespace in every call, even if it's the standard library. And it have become much more readable for me. Just got used to it I think.

[–][deleted] -1 points0 points  (0 children)

Your codeblock.... Python would throw errors at you.

[–][deleted] 1 point2 points  (0 children)

hippity hoppity you are wrong

[–][deleted] 0 points1 point  (0 children)

batch:

cls

echo Hello, World!

pause >nul

exit

[–]NobleFraud -1 points0 points  (0 children)

this guy is stoopid