User Tools

Site Tools


cpp:streams

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

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