C++ File Stream cin

C++ examples for File Stream:cin

Description

Click the following links for the tutorial for File Stream and cin.

  1. Read a decimal number, Converts decimal to octal and hex
  2. Read string and output
  3. Calculate Fahrenheit temperature and output
  4. Prompts for a number and then prints the square.
  5. Read a number from the keyboard and reports whether it is odd or even.
  6. Get a Number and prints their square roots, until the user either presses 0 or presses ENTER directly after the prompt
  7. Press enter to continue
  8. Read and output letter


  9. Uses getch() and putch() for char input and output.
  10. Read char one by one from user and add to string
  11. Use put() to put a newline character to cout
  12. Stores twelve months of sales and prints selected ones.
  13. Totals eight input int values from the user.
  14. Read a line of string with getline(), a character with get(), output with put() via cin
  15. Use cin.read() and cin.gcount()
  16. Inputting characters using cin member function getline


  17. Comparing cin and cin.get to read string
  18. Cin Stream Error States
  19. Read a string into character array variable state
  20. Read characters into array charArray until the character 'p' is encountered, up to a LIMIT of 10 characters.
  21. Read a string from the keyboard and determines its length
  22. Reading Phone Numbers with an Overloaded Stream Extraction Operator.
  23. Reads multiple lines, terminates on '$' character
  24. Avoids buffer overflow with cin.width
  25. Input checking with English Measure class
  26. Read an int from user
  27. Check if an input is a valid integer
  28. Ignoring the Enter key after the first character is read
  29. Type in two characters
  30. Read a character using cin