User Tools

Site Tools


cpp:osteams

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
cpp:osteams [2019/05/16 06:26]
gthanos
cpp:osteams [2020/05/17 18:10]
Line 1: Line 1:
-====== Output Streams ====== 
- 
-Όπως προαναφέρθηκε τα //streams// εισόδου χρησιμοποιούν τον τελεστη ''>>'' (//stream insertion operator//) για την ανάγνωση από το //stream//. Σε αναλογία με τα //input streams//, η //standard// βιβλιοθήκη παρέχει συναρτήσεις υπεφόρτωσης για τους βασικούς τύπους δεδομένων, ενώ δίνεται η δυνατότητα [[cpp:vector_overloading_binary_operators|υπερφόρτωσης]] για όλους τους μη βασικούς τύπους που θα χρειαστεί να κατασκευάσετε στα προγράμματα σας. Το παρακάτω παράδειγμα γραψίματος στην κονσόλα (//stdout//) είναι ενδεικτικό. 
- 
-<code cpp stdout.cpp> 
-#include <iostream> 
- 
-using namespace std; 
- 
-int main() { 
-  string str("Welcome C++"); 
-  const double PI = 3.14159; 
-  const int SIZE = 256; 
-   
-  cout << str << " in CE325 course." << endl; 
-  cout << "Constant PI: " << PI << endl; 
-  cout << "SIZE is: " << SIZE << endl; 
-} 
-</code> 
- 
-===== Formatting output streams ===== 
- 
- 
  
cpp/osteams.txt · Last modified: 2020/05/17 18:10 (external edit)