What's the deference between printf(); and cout ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

What's the deference between printf(); and cout ?

14th Oct 2016, 5:59 PM
Abdelrhman Elsaid
Abdelrhman Elsaid - avatar
1 Answer
+ 2
printf() is the function to print something to the standard output in C. In C++, you do that by sending stuff to the output stream object cout. C: printf("Hello world!\n"); C++: cout << "Hello world!" << endl;
14th Oct 2016, 6:24 PM
Zen
Zen - avatar