diff --git a/README.md b/README.md index 481ab84..fbe4cdd 100644 --- a/README.md +++ b/README.md @@ -118,8 +118,8 @@ for (x : y) a; // Range-based for loop e.g. do a; while (x); // Equivalent to: a; while(x) a; switch (x) { // x must be int - case X1: a; // If x == X1 (must be a const), jump here - case X2: b; // Else if x == X2, jump here + case X1: a; break; // If x == X1 (must be a const), jump here + case X2: b; break; // Else if x == X2, jump here default: c; // Else jump here (optional) } break; // Jump out of while, do, or for loop, or switch diff --git a/cheatsheet-as-sourcefile.cpp b/cheatsheet-as-sourcefile.cpp index 0d3dedd..3ea4f33 100644 --- a/cheatsheet-as-sourcefile.cpp +++ b/cheatsheet-as-sourcefile.cpp @@ -116,8 +116,8 @@ for (x : y) a; // Range-based for loop e.g. do a; while (x); // Equivalent to: a; while(x) a; switch (x) { // x must be int -case X1: a; // If x == X1 (must be a const), jump here -case X2: b; // Else if x == X2, jump here +case X1: a; break; // If x == X1 (must be a const), jump here +case X2: b; break; // Else if x == X2, jump here default: c; // Else jump here (optional) } break; // Jump out of while, do, or for loop, or switch