mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2025-05-07 07:18:31 +00:00
Merge pull request #681 from iirelu/learnc-fix
Commented out two broken lines in learnc.c
This commit is contained in:
commit
9002b07004
@ -281,10 +281,10 @@ int main() {
|
|||||||
// branching with multiple choices: switch()
|
// branching with multiple choices: switch()
|
||||||
switch (a) {
|
switch (a) {
|
||||||
case 0: // labels need to be integral *constant* expressions
|
case 0: // labels need to be integral *constant* expressions
|
||||||
do_stuff();
|
printf("Hey, 'a' equals 0!\n");
|
||||||
break; // if you don't break, control flow falls over labels
|
break; // if you don't break, control flow falls over labels
|
||||||
case 1:
|
case 1:
|
||||||
do_something_else();
|
printf("Huh, 'a' equals 1!\n");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
// if `some_integral_expression` didn't match any of the labels
|
// if `some_integral_expression` didn't match any of the labels
|
||||||
@ -293,7 +293,6 @@ int main() {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////
|
///////////////////////////////////////
|
||||||
// Typecasting
|
// Typecasting
|
||||||
///////////////////////////////////////
|
///////////////////////////////////////
|
||||||
|
Loading…
Reference in New Issue
Block a user