What is the actual difference in using
and usingCode:getchar();
Code:cin.get();
This is a discussion on getchar & cin.get within the C++ Programming forums, part of the General Programming Boards category; What is the actual difference in using Code: getchar(); and using Code: cin.get();...
What is the actual difference in using
and usingCode:getchar();
Code:cin.get();
One utilizes the cin istream object and one doesn't.
Sent from my iPadŽ
so wich is better or is some better in some codes and the other in other codes?
If you're only including <iostream> then cin.get() is better. If you're only including <cstdio> then getchar() is better.
In C++ you're most likely gonna be using cin.get().
Sent from my iPadŽ
okay thanks....