User Profile
Collapse
-
My intentions were to avoid multiple printf calls. I don't understand why, but I have been told in the past that system calls should always be reduced to as few as possible. -
As I understand it, the following should be well defined:
However, would there be a better way of doing this? Maybe this way?:Code:void main() { int i = 5; printf(" %d ", ++i); printf(" %d ", i++); printf(" %d ", --i); printf(" %d ", ++i); }
...Code:void main() { int i = 5; int j = ++i;Leave a comment:
-
global getline vs istream::getline()
Why is the string version of getline() a global function while the char* version is part of the istream objects? I don't understand the reasoning behind this separation. Why isn't the string version simply an overloaded version of istream::getlin e()?
This oddity has tripped me up several times, I tend to forget to use the global function and use the istream version.
No activity results to display
Show More
Leave a comment: