ineedhelpnow
- 649
- 0
why does cin come AFTER count and not before?
The discussion clarifies the order of operations between the output stream (cout) and the input stream (cin) in C++. It establishes that cout is buffered, meaning output may not appear immediately until the buffer is flushed, which can be done using endl or flush. The getline function is explained as a method to read input until the Enter key is pressed, storing the result in a specified string variable. The participants confirm that while cin can be used independently, it is common practice to prompt the user with cout before reading input.
PREREQUISITESC++ developers, programming students, and anyone looking to understand input/output operations in C++ applications.
ineedhelpnow said:why does cin come AFTER count and not before?
ineedhelpnow said:i don't understand. you can't SEE a cin statement though.
also what is a getline statement like getline (cin, s)
ineedhelpnow said:count << "whatever the heck" << usernum << " is.";
cin >> usernum
why do you do cin after count
cant you just do cin >> s?
ineedhelpnow said:oh i see. so for the example i gave cin was not necessary?