0

What should you use ?

I guy asked me should he use "Cin-Cout" or "Scanf-Printf" Well ... Which one will be your choice : "Car" or "Plane" ?

16th Oct 2016, 3:24 PM
Luan Nguyen
Luan Nguyen - avatar
8 Answers
+ 2
scanf() and printf() are input/output functions in C. In C++, you do this by sending stuff from cin and to cout respectively instead. Example: int n; cout << "Type a number" << endl; cin >> n; cout << "You entered: " << n << endl;
16th Oct 2016, 3:40 PM
Zen
Zen - avatar
+ 2
As I said, scanf() is a C function, not a C++ one. C++ isn't just an extension of C.
16th Oct 2016, 3:50 PM
Zen
Zen - avatar
+ 1
Hum, what?
16th Oct 2016, 3:26 PM
Zen
Zen - avatar
0
I mean, what the different between "Cin-Cout" and "Scanf-Printf"
16th Oct 2016, 3:29 PM
Luan Nguyen
Luan Nguyen - avatar
0
Thanks alot And oh ... One more question please : Why i can't use the "Scanf" in this shell ? It works with "Cin"
16th Oct 2016, 3:45 PM
Luan Nguyen
Luan Nguyen - avatar
0
OMG, THANKS ALOT BRO !
16th Oct 2016, 4:12 PM
Luan Nguyen
Luan Nguyen - avatar
0
In scanf and printf statement we have to specify which type of input or output we want to use with % sign. Like scanf("%d", &x) and in printf("%d", x). But with cin and cout programmer don't have to remember the data type of variable or functions. Because they are variable instance of istream for cin and ostream for cout. Which are declared in iostream. For example cin>>x; cout<<x;
16th Oct 2016, 5:09 PM
mahesh kumar
mahesh kumar - avatar
0
Car or plane? Car : cout and cin Plane : PRINTF and scanf How did you think this?! Anyway,I choose Car as my Pokemon :(
18th Oct 2016, 12:51 PM
JS of MC(not C++ || java)
JS of MC(not C++ || java) - avatar