CS246 Lecture Notes - Lecture 17: C String Handling, String Operations, A.Out

42 views8 pages

Document Summary

11:10 am main() must return int in c++ All our favourites are still available in c++ Imports basic i/o descriptions (i. e. it is the c++ standard i/o library) Output mechanism: std::cout << data << data << data std::endl prints newline and force a buffer flush using namespace std allows us to refer to std::cout and std::endl as just cout and endl. Formatted i/o: transfer data with implicit conversion of internal values to and from. Transfer data without conversion e. g. internal representation of integers and. C++ provides 3 (actually 4) input and output stream objects (through #include ) cin reads from standard input cout points to standard output (buffered) cerr points to standard error (un-buffered) E. g. from human readable form (e. g. convert to ascii) and floating points(binary numbers) E. g. cout << x; // print x to stdout cerr << x; // print x to stderr cin >> x; // get x from stdin (arrows pointing to the direction of data stream)

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents