istream


1. Reading Characters

#include <iostream>

int main() {
  char ch;
  std::cin >> ch;  // Reads a single character from standard input
  std::cout << ch << std::endl;
  return 0;
}

2. Reading a Line of Text

#include <iostream>

int main() {
  std::string line;
  std::getline(std::cin, line);  // Reads a line of text (including spaces) from standard input
  std::cout << line << std::endl;
  return 0;
}

3. Reading an Integer

4. Reading a Floating-Point Number

5. Reading a Boolean

6. Reading from a File

7. Reading from stdin (Standard Input)

8. Checking for End of File (EOF)

9. Ignoring White Space

10. Using Delimiters

11. Reading Binary Data

12. Writing Characters

13. Writing a Line of Text

14. Writing an Integer

15. Writing a Floating-Point Number

16. Writing a Boolean

17. Writing to a File

18. Writing to stdout (Standard Output)

19. Formatting Output

20. Using Manipulators

21. Overloading the >> Operator

22. Overloading the << Operator

23. Using std::stringstream

24. Reading from a String

25. Writing to a String

26. Using std::getline with Delimiters

27. Using std::getline with Character Count

28. Reading from a Pipe

29. Reading from a Socket

30. Reading from a Device

31. Reading from a Web Page

32. Reading from a Database

33. Reading from a JSON File

34. Reading from an XML File

35. Reading from an INI File

36. Reading from a YAML File

37. Reading from a CSV File

38. Reading from a Zip Archive

39. Reading from a GZip Archive

40. Reading from a BZip2 Archive

41. Reading from a Tar Archive

42. Reading from a Rar Archive

43. Reading from a 7-Zip Archive

44. Reading from a Zip64 Archive

45. Reading from a Brotli Archive

46. Reading from a Zstd Archive

47. Reading from a LZ4 Archive