+ 1
Is cout in c++ is as same as printf in c?I am new to programming.so anyone can elaborate please?
10 Answers
+ 5
no man printf is formatting, cout is just to display output
+ 3
iirc it was sth like printf("%s%s", "Hello ", "world!") idk i learned from my friend who learned C i might get it wrong but its actually similar to .format() from py3
+ 3
yeah they both produce output, im not rly knowledgeable about this tbh
+ 1
@Bharath
Cout is used for output.
Try not to worry about comparing the two languages for now.
I do not see the value in knowing the exact difference, between cout and printf if you are just starting.
+ 1
cout = C output
cin = C input
+ 1
@manual Thanks for answering! You've cleared my doubt!
+ 1
@Bharath
You're welcome!
0
@Cheese
What do you mean, by printf is for formating?
0
@Cheeze
I think I know what you mean.
There is a way to substitute string values like %d, using pointers.
edit
Otherwise printf is I believe a funtion for output, as well as formating.
0
@cheeze
same, I just use it as well as puts()
- learned that recently