0

Difference between cout and printf

What is the difference between cout and printf? I don’t get it.

10th Jul 2023, 9:53 AM
Michaelol
Michaelol - avatar
3 Respostas
+ 6
Michaelol , there are quite some differences between cout and printf() in c++. one of the most inportant is that printf() can do an output formatting. see more information here: https://www.techtually.com/printf-vs-cout/
10th Jul 2023, 10:43 AM
Lothar
Lothar - avatar
+ 4
printf()--- It is a formatting function that prints to the standard out. It prints to the console and takes a format specifier to print. It returns an integer value. cout--- It is an object of iostream in C++ language. It also prints to the console. It does not take any format specifier to print. It does not return anything.
10th Jul 2023, 10:37 AM
Mohammed Ahmed Ma’aruf
Mohammed Ahmed Ma’aruf - avatar
+ 1
cout and printf are both output functions used in different programming languages, namely C++ and C, respectively.
10th Jul 2023, 10:36 AM
Sakshi [Offline 🙃]
Sakshi [Offline 🙃] - avatar