CMPSC 16 Lecture Notes - Lecture 11: Decimal Mark, Boolean Expression, Scientific Notation
Document Summary
Tools for i/o and string & character manipulators. Precision is a member function of output streams. After out_steram. setf(ios::showpoint);, output of floating point numbers shows the decimal point even if all digits after the decimal point are zeroes. The width member function specifies the number of spaces for the next item: applies only to the next item of output. The entire item is always put in output. If too few spaces are specified, as many more spaces as needed are used. Any flag that is set can be unset. A function called in a nontraditional way: manipulators, in turn, call member functions, manipulators may or may not have arguments, used after the insertion operator. Streams can be arguments to a function: the fu(cid:374)(cid:272)tio(cid:374)(cid:859)s for(cid:373)al para(cid:373)eter for the strea(cid:373) (cid:373)ust (cid:271)e (cid:272)all-by-reference!! Input files used by a program may vary in length: programs may not be able to assume the number of items in the file.