Chapter 12


  1. The cin object with the stream extraction operator (>>) will ignore a leading newline character in the input buffer.

  2. The getline member function will not leave a newline character in the input buffer.

  3. You should always follow the cin object with the stream extraction operator (>>) with the no-argument ignore member function because the cin object with the stream extraction operator (>>) always leaves a newline character in the input buffer.

  4. You should never follow the getline member function with the no-argument ignore member function because the getline member function always removes the newline character that terminated input from the input buffer.

  5. The argument of the isdigit function is a character.

  6. The argument of the atoi function is a C-string.

  7. A C++ string class variable cannot directly use the atoi function to convert the string representation of a number to a number. However, it can copy its contents to a C-string using either the c_str or data member functions, after which the C-string can use the atoi function.

  8. The functions in the C++ standard library cctype, such as toupper and isdigit , are used with characters .

  9. The functions in the C++ standard library cstdlib, such as atoi and itoa, are used with C-strings.

  10. You cannot use an assignment operator to assign the value of one C-string to another. You will be assigning an address instead of a value.




C++ Demystified(c) A Self-Teaching Guide
C++ Demystified(c) A Self-Teaching Guide
ISBN: 72253703
EAN: N/A
Year: 2006
Pages: 148

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net