Lesson 5: work with data types

Statements that modify standard control

  • statement return - terminates function and possibly returns function result (if not void)
  • statement break
    • interrupts execution of cycles
    • can be also used in switch in order to terminate branches
  • statement continue
    • terminates only current iteration of a cycle

Data types

  1. using typedef declaration to create alias of an existing type
  2. structures (non object approach)
    • definition of structure members
    • operator . for accessing members of structures
  3. arrays
    • sequence of variables of the same type stored in memory one after the other
    • number of array items must be constant known at compile time
      • otherwise the array must be allocated dynamically using the new operator
    • indexing operator [] for accessing array elements
    • passing arrays to function

Attachments

Poslední úprava stránky: 24.11.2022, 12:39
Powered by PmWiki