What are the differences between printf and cout, similarly scanf and cin?and why? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

What are the differences between printf and cout, similarly scanf and cin?and why?

14th Jul 2020, 4:23 PM
Harsh Kant
Harsh Kant - avatar
4 Answers
+ 1
These are just different implementations. Every language may provide any amount of functionality within its standard libraries. cin & cout are C++ related. printf and scanf come from C. Since they are completely different implementations, there are many differences between them.
14th Jul 2020, 4:40 PM
Sandra Meyer
Sandra Meyer - avatar
+ 1
What do you mean by faster??
15th Jul 2020, 6:40 AM
Rawley
Rawley - avatar
0
Hope you know C and C++ are similar but not the same!
14th Jul 2020, 4:37 PM
Rawley
Rawley - avatar
0
But why printf and scanf is faster than cout and cin respectively in cpp?
15th Jul 2020, 1:24 AM
Harsh Kant
Harsh Kant - avatar