Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Table of Content Zone
maxLevel3
minLevel3
locationtop

Block

Block statement. Normally contains other statements. Begins and ends with curly braces. For example:

Code Block
void func() {       // block
}

Case Lable

Represents a case or default label in a switch statement. For example:

Code Block
void func(int i) {
    switch(i) {
    case 1:             // Case Label
        break;          
    case 3:             // Case Label
    default:            // Case Label
        break;
    }
  }

Simple

A statement that does not fall into any other statement category. The simple statement's body usually contains an expression. For example:

Code Block
void func(int & i) {
    i++;            // Simple statement
}

Empty

An empty ; statement. For example:

Code Block
void func() {
    if(true);             // Empty statement
}

break

Break statement. For example:

Code Block
bool bar();
void func() {
   while(1) {
      if (bar()) {
          break;    // break
      }
   }
}

case

Case statement. For example:

Code Block
void func(int i) {
    switch(i) {
    case 1: { break; }  // case
    case 2: { break; }  // case
    }
}

catch

Catch statement used for exception handling. For example:

Code Block
void bar();
void func(int i) {
    try {
       bar();
    } catch (...) {     // catch
    }
}

continue

Continue statement used in loops. For example:

Code Block
bool bar(int);
void func(int i) {
    while(i--) {
       if (bar(i)) {
          continue;     // continue
       }
    }
}

default

Default statement used inside a switch statement. For example:

Code Block
void func(int i) {
    switch(i) {
    case 1: { break; }
    case 2: { break; }
    default: { break; }            // default
    }
}

do

whjile

while

Do while loop statement. For example:

Code Block
void func(int i) {
    do {                            // do while
        i--;
    } while (i);
}

for

For loop statement. For example:

Code Block
void bar();
void func() {
   for (int i = 0; i < 10; i++) {  // for
      bar();
   }
}

for range

Range-based for loop statement. For example:

Code Block
void bar();
void func() {
   for (auto iterator : range_expr) {  // for
      bar();
   }
}

goto

Goto statement. For example:

Code Block
void func(bool done) {
   if (done) {
      goto end;             // goto
   }
   end:
}

if

If statement. For example:

Code Block
void func(bool done) {
   if (done) {             // if
       return; 
   }
}

return

Return statement. For example:

Code Block
int func() {
   return 0;               // return
}

switch

Switch statement. For example:

Code Block
void func(int i) {
    switch(i) {             // switch
    case 1: { break; }
    case 2: { break; }
    default: { break; }
    }
}

try

Try statement. For example:

Code Block
void bar();
void func(int i) {
    try {                  // try
        bar();
    } catch (...) {
    }
}

while

While statement. For example:

Code Block
void func(int i) {
   while (i--) {  // while
   }
}

...