cpp:streams
Differences
This shows you the differences between two versions of the page.
Next revisionBoth sides next revision | |||
cpp:streams [2019/05/14 12:07] – created gthanos | cpp:streams [2019/05/14 12:34] – [Standard Streams] gthanos | ||
---|---|---|---|
Line 14: | Line 14: | ||
+ | ===== Παράδειγμα χρήσης stream ===== | ||
+ | <code cpp ReadHeight.cpp> | ||
+ | #include < | ||
+ | using namespace std; | ||
+ | int main() { | ||
+ | double height; | ||
+ | do { | ||
+ | cout << "Enter your height (in meters): "; | ||
+ | cin >> height; | ||
+ | |||
+ | if(height > 0) | ||
+ | break; | ||
+ | | ||
+ | cerr << " | ||
+ | } while(true); | ||
+ | | ||
+ | cout << "You height is: " << height << " meters." | ||
+ | } | ||
+ | </ |
cpp/streams.txt · Last modified: 2020/05/17 16:53 (external edit)