ineedhelpnow
- 649
- 0
why does cin come AFTER count and not before?
The discussion revolves around the order of the input and output statements in C++, specifically why the cin statement typically follows the cout statement. Participants explore the implications of this order in terms of output visibility and user input.
cout buffers output, which may not be displayed until the buffer is flushed, either automatically or by using endl.cin statement, with some participants noting that it does not produce visible output.getline(cin, s), with explanations indicating it reads input until Enter is pressed and stores it in the string s.cin in certain contexts, questioning if it is needed after a cout statement.cout before reading input with cin.Participants generally express confusion and seek clarification on the order of cin and cout, indicating that multiple views exist regarding their usage and necessity in specific contexts. The discussion remains unresolved with varying interpretations of the statements.
Some assumptions about the behavior of output buffering and the necessity of input statements may not be fully articulated, leading to differing interpretations among participants.
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?