
- Forum
- Programming Talk
- C and C++
- Data types
Data types
This is a discussion on Data types within the C and C++ forums, part of the Programming Talk category; What are the data types that can be used in switch statement in C programming language? Can a user use ...
-
Data types
What are the data types that can be used in switch statement in C programming language? Can a user use all data types or is there any restriction on the usage of data types in switch statement?
-
05-14-2007, 04:29 PM #2
- Join Date
- Apr 2006
- Answers
- 124
No. All data types cannot be used with switch statement in C programming language. There is restriction for the usage of float data type. Only integers and char data type can be sued with switch statement in C programming language.
-
02-23-2012, 08:44 AM #3
- Join Date
- Feb 2012
- Answers
- 66
A switch works with the byte, short, char, and int primitive data types. It also works with enumerated types and a few special classes that "wrap" certain primitive types: Character, Byte, Short, and Integer.But a switch statement data type cannot be long.
-
Sponsored Ads
«
what are pointers
|
operator
»

Reply With Quote





