+ 1
%c,%d,%f this format id are useful in c++??
to print alphabet I am using printf("%c",k); in c. but this is helpful in cpp??
4 Answers
+ 6
Most C functions are available in C++, and many more. So you may use format specifiers with printf in C++ as well. But for stream I/O like in cout, cin or fstream objects, these specifiers are no longer used.
+ 5
@Ace
Thank you sir, I didn't know that. I have changed the answer.
+ 3
Personally, I prefer to continue using printf in c++ over cout. Plus you'll need those to format other strings that aren't being output to the console.