What is the benefit of c++ input and output over c input and output?

What is the benefit of c++ input and output over c input and output?
A. Type safety
B. Exception
C. Both Type safety & Exception
D. Sequence container
 
Answer: a
Explanation: C++ input and output are type safety that means we don't need to specify the type of variable we are printing.
eg:
in C we need to specify %d showing that an integer will be printed, whereas in C++ we just cout the variable.
printf("%d", a);
cout<<a;
 

Tìm kiếm

Back
Top