Exforsys
+ Reply to Thread
Results 1 to 3 of 3

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 ...

  1. #1
    sammy is offline Senior Member Array
    Join Date
    Apr 2006
    Answers
    144

    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?


  2. #2
    Rahulbatra is offline Senior Member Array
    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.


  3. #3
    Sandhya.Kishannag is offline Member Array
    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



Latest Article

Network Security Risk Assessment and Measurement

Read More...