+ 2

How many ways can you print "Hello World" using only one method or style in the c++ language?

These codes are not efficient as a code but they work very well at installing the data into my brain. Try it out an post your code here or give suggestions on a codes to try. https://code.sololearn.com/cTl9U8sROnOV/?ref=app

12th Sep 2017, 2:05 PM
Bob
Bob - avatar
5 Answers
+ 1
@Testing003 Is this what you were looking for? https://code.sololearn.com/cj63Yw0U762s/?ref=app
13th Sep 2017, 4:56 AM
Bob
Bob - avatar
+ 1
char str[]{"hey th"}; write(1, str, sizeof(str)-1); This only works on unix systems though. write is a function which takes 3 parameters. The second and third are the char array and the size of what gets printed respectively, and the first one is a number defining a file descriptor. In unix, standard output is 1, std error 2 and std input 0.
12th Sep 2017, 2:45 PM
Testing003
12th Sep 2017, 5:24 PM
Bob
Bob - avatar
+ 1
@Bob you could make the function virrual and do "hello world" apart from "hello universe", "hello bob"...
12th Sep 2017, 6:56 PM
Testing003
0
;)
13th Sep 2017, 11:17 AM
Testing003