Monday, August 8, 2011
Difference between cout and printf or cin and scanf?
Yes; cout and cin are C++ functions and printf and scanf are C functions. I rarely use the C-style IO functions in my C++ programs unless I need to do something that is compatible with C programs. You should also use anything but DevC++...anything but that; it's old and not supported and hasn't seen active development since I was in high school (about 5 years ago). You may be forgetting a library if you're getting an error on the system pause line; it's generally a good idea to stay away from system() functions at the beginning of your programming career until you understand what you're doing. There are other ways to pause execution, like prompting for some character and doing a cin.get() call.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment