top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration

Facebook Login
Site Registration

What type of variable can not be passed in switch-case statement in C?

+1 vote
137 views
What type of variable can not be passed in switch-case statement in C?
posted Oct 2, 2014 by anonymous

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

3 Answers

0 votes

Variable of float data type cannot be passed as an expression in switch case.

answer Oct 2, 2014 by Aarti Jain
0 votes

Agree with Aarti. Just to add non-integral values can't be used with case.

answer Oct 2, 2014 by Harshita
0 votes

Switch-Case statement should have variable which are from int family only like int, uint, long int, long unsigned int, short int, short unsigned int, char, signed char and enum.

What is not allowed:
array (any type), float or float family (double)

answer Oct 2, 2014 by Salil Agrawal
Contact Us
+91 9880187415
sales@queryhome.net
support@queryhome.net
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Bangalore-560102
Karnataka INDIA.
QUERY HOME
...