From 48313a48a64292f6c0bb012931229ea121be06a1 Mon Sep 17 00:00:00 2001 From: Nikhat Zaidi <44525743+NikhatZaidi@users.noreply.github.com> Date: Tue, 29 Jan 2019 21:40:02 +0530 Subject: [PATCH] Case can only be constant (#30360) case can be defined by a constant not by variable --- guide/english/c/switch/index.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/guide/english/c/switch/index.md b/guide/english/c/switch/index.md index c2aededb6f..5962849862 100644 --- a/guide/english/c/switch/index.md +++ b/guide/english/c/switch/index.md @@ -10,6 +10,8 @@ It's a list of possibilities, with an action for each possibility, and an option We exit from the switch by `break`. If the `break` statement is not reached before the beginning of the next case, the execution will fall through and begin executing the code in the next case, which means if you have no break statement in code, when first case is detected to be true, all the other cases below the one that is detected to be true (including itself) will be executed, which is often undesirable. +Each case must be a digit or a character i.e.. a constant but not a variable. + ## Syntax of switch...case ```c