Which of the following data types has the smallest size in C++?
- int
- float
- char
- double
In C++, the char data type typically takes up 1 byte of memory, which is smaller than int, float, or double. The exact size of int can vary depending on the platform, but char is defined by the standard to always be at least 1 byte, making it the smallest of the given options.
Loading...
Related Quiz
- Which file opening mode in C++ will allow you to append data at the end of the file’s content?
- Consider a class hierarchy with Base and Derived classes. An object of Derived throws an exception that is caught in a catch block for Base exceptions. What considerations might be relevant to the use of dynamic_cast inside the catch block?
- In C++, the method used to allocate memory dynamically during runtime within the object is called _______.
- Unlike if-else, switch-case in C++ does not support _______ type for case values.
- Which type of loop is best suited when the number of iterations is known ahead of time?