+ 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
5 Answers
+ 1
@Testing003
Is this what you were looking for?
https://code.sololearn.com/cj63Yw0U762s/?ref=app
+ 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.
+ 1
Here is another example.
https://code.sololearn.com/cSsIjbsD9xOv/?ref=app
+ 1
@Bob you could make the function virrual and do "hello world" apart from "hello universe", "hello bob"...
0
;)