← All lectures

Lecture 05 · 40 min

Data Types & Operators

Identifiers, primitive types, assignment, I/O via cin/cout, type compatibility, and boolean expressions.

IdentifiersVariablesAssignmentcin / coutType conversionRelational & logical operators
Slide 1 / 18

What is an identifier?

An identifier is any name you give to something in your program — a variable, a function, a constant, etc.

Rules:

  • Must start with a letter or underscore (_)
  • Can contain letters, digits, underscores
  • Case-sensitive — Work and work are different
  • Cannot be a reserved keyword

Best practice: use descriptive names. studentAge tells you far more than just x.

← / → navigateF fullscreenEsc exit⌘K search