Lesson 4 - characters, switch statement

Work with characters

  • data type char
  • characters constants
    • escape sequences
  • getting ASCII code
    • static_cast<>() operator
  • example:
    • conversion to lower case (upper case) letter
    • use of ternary operator ?:

Statement switch

  • syntax
    • selector
    • labels, branches
      • falling through branches
      • statement break
    • label default
  • comparison to nested if-else statements
  • example
    • text oriented menu
    • simple event loop
      • infinite cycle
      • can be interrupted by calling the break statement
    • splitting source into several source and header files
      • independant modules

Home assignment

Create program that will print ASCII table on standard output Use the setw manipulator to format the table.User will decide if he/she wishes to print full table or only its lower half. Please, upload the solution to MS Teams group.


Poslední úprava stránky: 21.10.2022, 08:57
Powered by PmWiki