Skip to content

Commit 89e307c

Browse files
author
Colin Robertson
committed
Update date
1 parent a124d74 commit 89e307c

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

‎docs/c-language/switch-statement-c.md‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: "switch Statement (C)"
3-
ms.date: "11/04/2016"
3+
ms.date: "04/25/2020"
44
f1_keywords: ["switch"]
55
helpviewer_keywords: ["switch keyword [C]"]
66
ms.assetid: fbede014-23bd-4ab1-8094-c8d9d9cb963a
@@ -55,15 +55,15 @@ The following examples illustrate **switch** statements:
5555
switch( c )
5656
{
5757
case 'A':
58-
capa++;
58+
capital_a++;
5959
case 'a':
60-
lettera++;
60+
letter_a++;
6161
default :
6262
total++;
6363
}
6464
```
6565

66-
All three statements of the **switch** body in this example are executed if `c` is equal to `'A'`, since no **break** statement appears before the following case. Execution control is transferred to the first statement (`capa++;`) and continues in order through the rest of the body. If `c` is equal to `'a'`, `lettera` and `total` are incremented. Only `total` is incremented when `c` doesn't equal `'A'` or `'a'`.
66+
All three statements of the **switch** body in this example are executed if `c` is equal to `'A'`, since no **break** statement appears before the following case. Execution control is transferred to the first statement (`capital_a++;`) and continues in order through the rest of the body. If `c` is equal to `'a'`, `letter_a` and `total` are incremented. Only `total` is incremented when `c` doesn't equal `'A'` or `'a'`.
6767

6868
```C
6969
switch( i )
@@ -92,11 +92,11 @@ switch( c )
9292
case 'c' :
9393
case 'd' :
9494
case 'e' :
95-
case 'f' : hexcvt(c);
95+
case 'f' : convert_hex(c);
9696
}
9797
```
9898

99-
In this example, if *constant-expression* equals any letter between `'a'` and `'f'`, the `hexcvt` function is called.
99+
In this example, if *constant-expression* equals any letter between `'a'` and `'f'`, the `convert_hex` function is called.
100100

101101
### Microsoft-specific
102102

0 commit comments

Comments
 (0)