Unlike if-else, switch-case in C++ does not support _______ type for case values.
- floating-point
- integer
- character
- boolean
In C++, switch-case constructs don't support floating-point types for case values. This means you can't use float or double values as cases. On the other hand, if-else structures can easily handle conditions based on floating-point values.
Loading...
Related Quiz
- In a complex software project where multiple classes are interacting with one another, you discover that there is a significant performance bottleneck during the creation and deletion of objects, which is causing inefficiency. What strategy or principle might be applied to manage object creation and deletion more efficiently?
- What is the primary purpose of using enum in C++?
- What is the maximum number of conditions that can be nested within each other using nested if-else structures?
- You are developing a multi-threaded application where multiple clients are sending data to a server. Each client is handled in a separate thread and communicates with the server in a loop. If a client sends an incorrect data format, the server should ignore it and wait for the next data. How might continue be used in this case?
- You're developing an embedded system with constrained memory. What should be the main consideration when choosing between using float and double data types?