Data types in C ++ Programming MCQ Questions and Answers

1. Which of the following is guaranteed by the C++ standard about the size of char?
A) sizeof(char) may be greater than sizeof(int)
B) sizeof(char) is always 2 bytes
C) sizeof(char) is always equal to sizeof(short)
D) sizeof(char) is defined to be 1 (as the unit of size)
Answer: D) sizeof(char) is defined to be 1 (as the unit of size)

2. Which integral type is guaranteed to be at least 16 bits by the C++ standard?
A) long long
B) short
C) char
D) bool
Answer: B) short

3. Which statement about int in standard C++ is correct?
A) int is always 64 bits
B) int is guaranteed to be larger than long
C) int is at least 16 bits long
D) int must be equal to short
Answer: C) int is at least 16 bits long

4. Which type in C++ holds true/false values as its only semantic values?
A) int
B) char
C) bool
D) void
Answer: C) bool

5. Which of the following is a signed integer type modifier in C++?
A) unsigned
B) floating
C) signed
D) static
Answer: C) signed

6. Which keyword introduces a user-defined enumeration type?
A) struct
B) enum
C) typedef
D) union
Answer: B) enum

7. Which C++ type is meant to represent a character but may be signed or unsigned depending on implementation?
A) wchar_t
B) char32_t
C) char
D) char16_t
Answer: C) char

8. What is wchar_t primarily used for in C++?
A) To store floating-point numbers
B) To represent wide characters for extended character sets
C) For boolean logic
D) As an alias for int
Answer: B) To represent wide characters for extended character sets

9. Which of the following is true about long long in C++?
A) It must be exactly 32 bits
B) It is at least 64 bits on most modern implementations (standard requires at least 64 for typical usage but it must be at least as large as long)
C) It is smaller than short
D) It cannot be signed
Answer: B) It is at least 64 bits on most modern implementations (standard requires at least 64 for typical usage but it must be at least as large as long)

10. What does the sizeof operator return in C++?
A) The number of bits in a type
B) The size in bytes (where char is 1) of an object or type
C) The maximum value of the type
D) Whether the type is signed or unsigned
Answer: B) The size in bytes (where char is 1) of an object or type

11. Which C++ type guarantees at least 32 bits in width according to the standard minimums?
A) short
B) long
C) char
D) bool
Answer: B) long

12. What is the primary difference between float and double in C++?
A) float can store integers only
B) double is always an integral type
C) double typically has greater precision than float
D) float always uses more memory than double
Answer: C) double typically has greater precision than float

13. Which literal suffix denotes a long double literal in C++?
A) f
B) l or L
C) L (or l)
D) u
Answer: C) L (or l)

14. Which of the following types is considered a fundamental arithmetic type?
A) std::string
B) struct
C) void
D) int
Answer: D) int

15. Which statement about unsigned int is correct?
A) It can represent negative numbers
B) It has the same representation as float
C) It represents non-negative integers and wraps modulo 2^N on overflow
D) It can never be compared with signed integers
Answer: C) It represents non-negative integers and wraps modulo 2^N on overflow

16. Which type category does std::nullptr_t belong to?
A) Arithmetic types
B) Null pointer type
C) Enumeration types
D) Array types
Answer: B) Null pointer type

17. What is the effect of the signed type modifier on char?
A) It always makes char 32 bits
B) It indicates that the char type can represent negative values (implementation-defined whether char is signed by default)
C) It converts char into a floating-point type
D) It makes char equal to bool
Answer: B) It indicates that the char type can represent negative values (implementation-defined whether char is signed by default)

18. Which of the following is not a fundamental type in C++?
A) bool
B) int
C) double
D) std::vector<int>
Answer: D) std::vector<int>

19. Which type is used to represent very large integral values on systems that support it, and often requires the suffix LL for literals?
A) short
B) int
C) long long
D) float
Answer: C) long long

20. Which type is typically used to represent a single Unicode code point in modern C++?
A) char
B) wchar_t
C) char32_t
D) char16_t
Answer: C) char32_t

21. What is an important property of const when applied to a variable of a fundamental type?
A) The variable can be modified anywhere
B) The value cannot be changed after initialization
C) It changes the type to floating-point
D) It makes the variable global
Answer: B) The value cannot be changed after initialization

22. Which of the following best describes decltype when applied to an expression?
A) It converts the expression to string
B) It yields the compile-time type of the expression
C) It executes the expression at runtime
D) It always yields int
Answer: B) It yields the compile-time type of the expression

23. Which one of these is a character literal type introduced in C++11 for UTF-16?
A) char
B) wchar_t
C) char16_t
D) char32_t
Answer: C) char16_t

24. Which of the following statements about void in C++ is true?
A) void can be used as a variable type to hold values
B) void indicates absence of type, commonly used for functions that return nothing
C) void is an arithmetic type
D) void is equivalent to int
Answer: B) void indicates absence of type, commonly used for functions that return nothing

25. Which term best describes an aggregate built-in type like int or double?
A) User-defined type
B) Fundamental type (or built-in arithmetic type)
C) Reference type
D) Class type
Answer: B) Fundamental type (or built-in arithmetic type)

26. Which C++ type is the result of pointer-to-member operations and can be used to represent the absence of an object pointer?
A) int*
B) double
C) nullptr_t
D) void
Answer: C) nullptr_t

27. Which C++ feature allows you to create an alias for a type name?
A) enum
B) class
C) struct
D) typedef or using
Answer: D) typedef or using

28. What does integral promotion do in C++?
A) Converts floating types to integers
B) Converts small integer types (char, short) to int or unsigned int in expressions
C) Converts int to long always
D) Converts bool to float
Answer: B) Converts small integer types (char, short) to int or unsigned int in expressions

29. Which of these is true about enumerations (enum) in C++11 (scoped enum class)?
A) They implicitly convert to integers
B) enum class is strongly typed and does not implicitly convert to int
C) They cannot have a fixed underlying type
D) They are stored in double
Answer: B) enum class is strongly typed and does not implicitly convert to int

30. Which of the following is the correct effect of the unsigned modifier?
A) It allows negative values only
B) It changes the range so the type represents non-negative values only (increasing positive range)
C) It converts a type to floating-point
D) It makes the type a pointer
Answer: B) It changes the range so the type represents non-negative values only (increasing positive range)

31. Which of the following is true about long double?
A) It is always exactly the same as double on all implementations
B) It usually offers equal or greater precision than double depending on platform
C) It is the same as float
D) It cannot represent fractional numbers
Answer: B) It usually offers equal or greater precision than double depending on platform

32. Which of the following is not true about fundamental arithmetic conversions?
A) They may convert operands to a common type for an operation
B) They only affect user-defined types
C) They can result in loss of precision or range
D) They include integer promotions and floating-integer conversions
Answer: B) They only affect user-defined types

33. What is the semantic meaning of nullptr introduced in C++11?
A) It is an integer zero literal
B) It is a null pointer literal of type std::nullptr_t
C) It is a boolean false alias
D) It represents an empty string
Answer: B) It is a null pointer literal of type std::nullptr_t

34. Which type qualifier prevents modification of the referenced object through that reference?
A) volatile
B) mutable
C) register
D) const
Answer: D) const

35. Which is the standard minimum that CHAR_BIT indicates in C++?
A) Minimum number of chars in an int
B) Number of bits in a char (at least 8 on most systems but not mandated by standard beyond being implementation-defined)
C) Maximum number of bytes in a double
D) Minimum bytes in long
Answer: B) Number of bits in a char (at least 8 on most systems but not mandated by standard beyond being implementation-defined)

36. Which of the following best describes a POD (Plain Old Data) type in C++11 terms?
A) A type that must be a class with virtual methods
B) A trivially copyable and standard-layout type (simple aggregate or scalar)
C) A type that contains std::string by default
D) A type that cannot be copied
Answer: B) A trivially copyable and standard-layout type (simple aggregate or scalar)

37. What is the role of type qualifiers such as volatile?
A) They convert types to integers automatically
B) They indicate to the compiler that a variable may change in ways unknown to the implementation (e.g., hardware), preventing certain optimizations
C) They ensure the variable is constant
D) They are only used with classes
Answer: B) They indicate to the compiler that a variable may change in ways unknown to the implementation (e.g., hardware), preventing certain optimizations

38. Which of the following is a correct reason to use char16_t?
A) For 8-bit ASCII only
B) To hold UTF-16 code units in portable code
C) For representing 64-bit integers
D) For floating-point arithmetic
Answer: B) To hold UTF-16 code units in portable code

39. Which type usually has guaranteed representation of at least 8 bits?
A) int
B) short
C) char
D) long long
Answer: C) char

40. Which of these statements about type aliases created with using is true?
A) They execute code at runtime
B) They change how the compiler stores values
C) They provide a new name for a type (alias), equivalent to typedef semantics
D) They create a copy of the underlying type at runtime
Answer: C) They provide a new name for a type (alias), equivalent to typedef semantics

41. What is the main property of a signed integer type?
A) It cannot store zero
B) It can represent both negative and positive values
C) It stores floating point numbers
D) It always uses less memory than unsigned types
Answer: B) It can represent both negative and positive values

42. Which of the following correctly describes short int in relation to int?
A) short int must be wider than int
B) short int is no larger than int (implementation ensures sizeof(short) <= sizeof(int))
C) short int must be equal to long
D) short int cannot be used with signed modifier
Answer: B) short int is no larger than int (implementation ensures sizeof(short) <= sizeof(int))

43. Which type conversion does NOT change the bit-pattern of the value (ignoring sign interpretation) for unsigned integer types?
A) Implicit conversion to float
B) Conversion to a larger unsigned type preserving value (modulo rules apply if needed)
C) Conversion to bool
D) Conversion to double
Answer: B) Conversion to a larger unsigned type preserving value (modulo rules apply if needed)

44. Which of the following is true about the default underlying type of a plain enum in C++ (unscoped enum)?
A) It must be long long
B) The underlying type is an integral type capable of representing all enumerator values (implementation-chosen by default)
C) It is always int64_t
D) It is always unsigned int
Answer: B) The underlying type is an integral type capable of representing all enumerator values (implementation-chosen by default)

45. What ensures that sizeof(bool) is defined in C++?
A) bool is not a standard type
B) bool is a fundamental type and sizeof can be applied to it like other types
C) bool is always 1 bit
D) sizeof is undefined for bool
Answer: B) bool is a fundamental type and sizeof can be applied to it like other types

46. Which is a correct statement about floating-point types and exactness?
A) Floating-point types always represent decimal numbers exactly
B) Floating-point types represent approximate values and may have rounding errors
C) Floating-point types cannot represent fractional parts
D) Floating-point types are interchangeable with integers without conversion
Answer: B) Floating-point types represent approximate values and may have rounding errors

47. Which of the following is true about auto in C++11 for deducing types?
A) auto always deduces int only
B) auto deduces the type from the initializer expression
C) auto is used to define arrays
D) auto is equivalent to void
Answer: B) auto deduces the type from the initializer expression

48. Which of the following describes a fixed-width integer type from <cstdint> like int32_t?
A) It is optional and only appears on some platforms
B) If provided, it has exactly the specified width in bits (e.g., int32_t is exactly 32 bits)
C) It is always a typedef for long
D) It is a floating-point type
Answer: B) If provided, it has exactly the specified width in bits (e.g., int32_t is exactly 32 bits)

49. When does a float literal in code become double by default?
A) When suffixed by f
B) By default, unsuffixed floating literals are of type double
C) When used in pointer arithmetic
D) When assigned to an int
Answer: B) By default, unsuffixed floating literals are of type double

50. Which statement about volatile variables is correct?
A) volatile guarantees atomicity of operations
B) volatile makes variables thread-safe
C) volatile tells the compiler not to optimize accesses because the value can change in unexpected ways
D) volatile makes the variable constant
Answer: C) volatile tells the compiler not to optimize accesses because the value can change in unexpected ways

51. Which of these types is used for pointer arithmetic and guaranteed to be able to hold any object pointer when needed (std::uintptr_t is related but not required)?
A) float
B) int
C) std::uintptr_tif provided inprovides an unsigned integer type capable of holding a pointer
D) bool
Answer: C)std::uintptr_tif provided in` provides an unsigned integer type capable of holding a pointer

52. What is the effect of using signed and unsigned together (e.g., signed unsigned int)?
A) It creates a new floating type
B) It is invalid; a type cannot be both signed and unsigned simultaneously
C) It becomes long double
D) It becomes bool
Answer: B) It is invalid; a type cannot be both signed and unsigned simultaneously

53. Which is a correct assertion about integer overflow for signed integers in C++?
A) It is defined to wrap around like unsigned types
B) Signed integer overflow is undefined behavior
C) Signed overflow is guaranteed to throw exceptions
D) Signed overflow converts the value to double automatically
Answer: B) Signed integer overflow is undefined behavior

54. Which of the following correctly describes std::byte introduced in C++17?
A) It is identical to char in all respects
B) It is a distinct byte type intended for raw memory manipulation and not an arithmetic type
C) It is a floating-point type
D) It behaves like bool
Answer: B) It is a distinct byte type intended for raw memory manipulation and not an arithmetic type

55. When converting from floating point to integer types, what generally happens?
A) The value is rounded to the nearest integer by default
B) The fractional part is truncated (rounded toward zero)
C) It causes a compile-time error always
D) The integer receives the same bit-pattern as the float
Answer: B) The fractional part is truncated (rounded toward zero)

56. Which one of the following is a type category in C++?
A) mutable types
B) scalar types
C) reference types only
D) function pointer types only
Answer: B) scalar types

57. Which of the following is true about pointer types?
A) Pointers have the same representation as int always
B) A pointer holds an address and its exact representation is implementation-defined
C) Pointers cannot be compared
D) Pointers are always 64 bits in size by the standard
Answer: B) A pointer holds an address and its exact representation is implementation-defined

58. Which type is intended to hold the result of sizeof in a portable manner?
A) int
B) std::size_t
C) short
D) long long
Answer: B) std::size_t

59. Which of the following best describes reference types in C++ (e.g., int&)?
A) They are objects that can be reseated to reference another object
B) They are aliases to existing objects and cannot be null or reseated once initialized
C) They are always implemented as pointers and stored separately
D) They are a kind of floating-point type
Answer: B) They are aliases to existing objects and cannot be null or reseated once initialized

60. Which of the following is true about complex numbers from <complex> relative to fundamental types?
A) They are fundamental types
B) They are library types built using fundamental types (not fundamental themselves)
C) They are always float under the hood
D) They cannot be templated
Answer: B) They are library types built using fundamental types (not fundamental themselves)

61. What does a trivially copyable type mean?
A) It cannot be copied at all
B) Its copy can be performed with memcpy and no special copy constructor logic is needed
C) It always uses dynamic memory during copying
D) It requires virtual function tables to copy
Answer: B) Its copy can be performed with memcpy and no special copy constructor logic is needed

62. Which type is most appropriate to store file sizes and counts of elements returned by sizeof?
A) int
B) long long
C) std::size_t
D) short
Answer: C) std::size_t

63. Which of the following statements is true about char32_t?
A) It stores ASCII only
B) It is intended to store UTF-32 code units (32-bit code points)
C) It is a signed integer type by default
D) It is a floating type
Answer: B) It is intended to store UTF-32 code units (32-bit code points)

64. Which C++ property makes float and double different from integers in operations like division?
A) Integers can represent fractions
B) Floating-point types represent real numbers with fractional parts and exponent, while integers represent whole numbers
C) Floats are exact representations of decimals
D) Doubles are integral types
Answer: B) Floating-point types represent real numbers with fractional parts and exponent, while integers represent whole numbers

65. Which of the following is not a standard integer promotion or conversion rule?
A) Smaller integer types are promoted to int or unsigned int in many expressions
B) Converting double to long double is called integral promotion
C) Unsigned conversions may change numeric interpretation
D) Floating-integral conversions are well-defined but may lose precision
Answer: B) Converting double to long double is called integral promotion

66. What is a characteristic of std::int_least32_t from <cstdint>?
A) It is exactly 32 bits wide always
B) It is the smallest type provided that is at least 32 bits wide
C) It is always the same as int32_t on all platforms
D) It is a floating-point alias
Answer: B) It is the smallest type provided that is at least 32 bits wide

67. Which of these correctly describes the bool type underlying representation?
A) bool occupies zero bytes
B) bool is stored as an integral type large enough to hold true and false (exact size implementation-defined), and conversions follow standard rules
C) bool must be 1 bit by standard
D) bool is identical to char32_t
Answer: B) bool is stored as an integral type large enough to hold true and false (exact size implementation-defined), and conversions follow standard rules

68. Which of the following is a correct use of typedef or using?
A) typedef int 5myint;
B) using = int myint;
C) typedef long MyLong; or using MyLong = long;
D) typedef int;
Answer: C) typedef long MyLong; or using MyLong = long;

69. Which standard header defines fixed-width integer types like int16_t?
A) <iostream>
B) <cstdint>
C) <string>
D) <vector>
Answer: B) <cstdint>

70. Which term best describes an object with static storage duration?
A) It is allocated on the stack
B) It exists for the entire duration of program execution
C) It can be destroyed automatically at scope exit only
D) It is always a temporary object
Answer: B) It exists for the entire duration of program execution

71. Which of the following is true about char and character literals like ‘A’?
A) Character literals are always of type int in C++
B) Character literals like ‘A’ are of type char (multi-character and wide literals differ)
C) ‘A’ is a bool type
D) ‘A’ is a float literal
Answer: B) Character literals like ‘A’ are of type char (multi-character and wide literals differ)

72. Which of the following types is allowed as the underlying type for an enum class?
A) float
B) Any integral type (e.g., int, unsigned long)
C) std::string
D) double
Answer: B) Any integral type (e.g., int, unsigned long)

73. What is the main role of std::intmax_t in <cstdint>?
A) To be the smallest integer type
B) To represent the largest signed integer type provided by the implementation
C) To act as a floating point type
D) To be always equal to long long on all platforms
Answer: B) To represent the largest signed integer type provided by the implementation

74. Which of the following best describes a scalar type?
A) It is an aggregate of multiple values
B) A scalar type is an arithmetic type, pointer, or enumeration type that represents a single value
C) It always contains virtual methods
D) It must be an object with member functions
Answer: B) A scalar type is an arithmetic type, pointer, or enumeration type that represents a single value

75. What does std::nullptr_t allow you to do in overload resolution?
A) It causes ambiguous function calls always
B) It provides a distinct type for null pointer literal improving overload resolution for pointer vs integral overloads
C) It converts automatically to int only
D) It is identical to 0 in all contexts
Answer: B) It provides a distinct type for null pointer literal improving overload resolution for pointer vs integral overloads

76. Which built-in type would you choose to represent currency fractional cents with exactness (avoid floating point)?
A) float
B) double
C) long long or an appropriate fixed-point integer representation
D) char
Answer: C) long long or an appropriate fixed-point integer representation

77. Which of the following is true about std::int_fast32_t?
A) It is always 32 bits and slow
B) It is the fastest minimum type provided that is at least 32 bits wide on the platform
C) It is always equal to int32_t
D) It is a floating-point type
Answer: B) It is the fastest minimum type provided that is at least 32 bits wide on the platform

78. Which of these statements about volatile and const together is correct?
A) volatile const means the value will never change
B) volatile const means the value may change outside program control, but the program must not modify it
C) volatile const converts to int automatically
D) volatile const is invalid syntax
Answer: B) volatile const means the value may change outside program control, but the program must not modify it

79. Which of the following best describes when a type is called standard-layout?
A) It uses virtual inheritance
B) Its memory layout is compatible with C structs under certain conditions (no mixing of access specifiers in problematic ways, etc.)
C) It cannot be copied
D) It must contain only private members
Answer: B) Its memory layout is compatible with C structs under certain conditions (no mixing of access specifiers in problematic ways, etc.)

80. Which of the following C++ types can be used to represent integer values that are at least 8 bits wide?
A) char (if CHAR_BIT >= 8)
B) std::int_least8_t (if provided) or signed char / unsigned char depending on signedness
C) void
D) bool only
Answer: B) std::int_least8_t (if provided) or signed char / unsigned char depending on signedness

81. Which of the following is true about long long and long ordering?
A) sizeof(long) must be larger than sizeof(long long)
B) sizeof(long long) is at least as large as sizeof(long) (implementations ensure long long is not smaller than long)
C) long and long long must be equal in size always
D) long must be 64 bits
Answer: B) sizeof(long long) is at least as large as sizeof(long) (implementations ensure long long is not smaller than long)

82. Which of the following best describes promoted arithmetic type in C++ expressions?
A) The type is always bool
B) Operands are converted to a common type based on usual arithmetic conversions before the operation
C) No conversions happen in mixed-type arithmetic
D) Promotions only apply to user-defined types
Answer: B) Operands are converted to a common type based on usual arithmetic conversions before the operation

83. Which C++ type is most appropriate for indexing arrays portably?
A) int always
B) float
C) std::size_t because it is designed to represent sizes and indices
D) short
Answer: C) std::size_t because it is designed to represent sizes and indices

84. Which of the following is true about character literal u8″…” in C++11 and later?
A) It creates a char16_t string literal
B) It creates a UTF-8 encoded narrow string literal of type const char[]
C) It is a wide string literal of type wchar_t[]
D) It is an integer literal
Answer: B) It creates a UTF-8 encoded narrow string literal of type const char[]

85. Which of the following statements is true for float and IEEE-754 single precision?
A) C++ standard requires IEEE-754 exactly for float
B) Many implementations use IEEE-754, but C++ does not mandate a specific floating-point format
C) IEEE-754 means float is exact for decimal fractions always
D) float always has 80-bit precision
Answer: B) Many implementations use IEEE-754, but C++ does not mandate a specific floating-point format

86. Which of the following accurately describes the signed char type?
A) It is identical to char always
B) It is explicitly a signed 8-bit (if CHAR_BIT==8) or implementation-defined-width integer type intended for small integers/characters
C) It cannot be used in arithmetic
D) It cannot be converted to int
Answer: B) It is explicitly a signed 8-bit (if CHAR_BIT==8) or implementation-defined-width integer type intended for small integers/characters

87. Which of the following statements about decltype(auto) is true?
A) It always yields int
B) decltype(auto) deduces type using decltype rules on the initializer (preserves references if present)
C) It deduces types like typedef only
D) It only works with pointers
Answer: B) decltype(auto) deduces type using decltype rules on the initializer (preserves references if present)

88. What is true about the representation of signed integers in C++?
A) C++ mandates two’s complement representation only
B) C++ allows implementations to use two’s complement, one’s complement, or sign-and-magnitude; two’s complement is common but not mandated by older standards (recent standards have clarified but historically it was implementation-defined)
C) Signed integers are always stored as ASCII
D) Signed integers must be the same as unsigned in representation
Answer: B) C++ allows implementations to use two’s complement, one’s complement, or sign-and-magnitude; two’s complement is common but not mandated by older standards (recent standards have clarified but historically it was implementation-defined)

89. Which of these is true about the register storage-class specifier in modern C++?
A) It is required for optimizing variables
B) It is deprecated/unused in modern C++; compilers ignore it and rely on optimization heuristics
C) It forces variables to be stored in CPU registers always
D) It changes type semantics fundamentally
Answer: B) It is deprecated/unused in modern C++; compilers ignore it and rely on optimization heuristics

90. What does the phrase “type punning” commonly refer to?
A) Using puns in type names
B) Interpreting the same memory as different types (often via unions or pointer casts), which can invoke undefined behavior if rules are violated
C) Converting int to double only
D) Using only auto for types
Answer: B) Interpreting the same memory as different types (often via unions or pointer casts), which can invoke undefined behavior if rules are violated

91. Which of the following is true about variable-length arrays (VLAs) in standard C++?
A) Standard C++ fully supports VLAs like C99 does
B) Standard C++ does not support C99-style VLAs; array sizes must be compile-time constants (except dynamic allocation or other constructs)
C) VLAs are mandatory in C++17
D) VLAs are the same as std::vector by syntax
Answer: B) Standard C++ does not support C99-style VLAs; array sizes must be compile-time constants (except dynamic allocation or other constructs)

92. Which of the following types is required to have the ability to represent all non-negative values of size_t when promoting sizes?
A) int
B) std::size_t and types used for memory sizes/indices
C) bool
D) char16_t
Answer: B) std::size_t and types used for memory sizes/indices

93. Which of the following correctly describes the relationship between short, int, long, and long long?
A) sizeof(short) > sizeof(int) > sizeof(long) always
B) sizeof(short) <= sizeof(int) <= sizeof(long) <= sizeof(long long) is guaranteed by standard
C) short is always 64 bits
D) They must all be equal in size by standard
Answer: B) sizeof(short) <= sizeof(int) <= sizeof(long) <= sizeof(long long) is guaranteed by standard

94. Which of the following describes how a union stores its members?
A) Each member gets its own separate memory region simultaneously
B) All members share the same memory location; only one member is active at a time
C) Union members are stored in a linked list
D) Unions are not allowed to have fundamental types
Answer: B) All members share the same memory location; only one member is active at a time

95. Which of the following is true about a nullptr compared to 0 used as a null pointer constant?
A) nullptr is an integer type
B) nullptr has type std::nullptr_t and is unambiguous as a null pointer literal, unlike 0 which is an integer literal historically used as null pointer constant
C) 0 and nullptr are always identical in overload resolution
D) nullptr cannot be compared to pointers
Answer: B) nullptr has type std::nullptr_t and is unambiguous as a null pointer literal, unlike 0 which is an integer literal historically used as null pointer constant

96. Which of these statements about std::byte and arithmetic is correct?
A) You can perform arithmetic (+, -) directly on std::byte without casts
B) std::byte is not an arithmetic type; you must cast to an integer type to do arithmetic
C) std::byte implicitly converts to int always
D) std::byte stores floating point values
Answer: B) std::byte is not an arithmetic type; you must cast to an integer type to do arithmetic

97. Which of the following best describes an aggregate in C++?
A) A type that is always polymorphic
B) A class/struct/array with certain properties that allows aggregate initialization (no user-provided constructors, no private or protected non-static data members, etc.)
C) A type that must be allocated on the heap
D) A type with virtual functions only
Answer: B) A class/struct/array with certain properties that allows aggregate initialization (no user-provided constructors, no private or protected non-static data members, etc.)

98. Which of the following is true about reinterpret_cast operations?
A) They are always safe and defined across platforms
B) They perform implementation-defined reinterpretation of bit patterns and should be used with care
C) They convert integers to floating point precisely
D) They are equivalent to static_cast for class hierarchies
Answer: B) They perform implementation-defined reinterpretation of bit patterns and should be used with care

99. Which of the following describes when std::initializer_list<T> is used?
A) It is used only for int types
B) It is used to allow list-initialization (brace-enclosed initializer lists) for functions and constructors
C) It prevents any initialization from happening
D) It only works with pointers
Answer: B) It is used to allow list-initialization (brace-enclosed initializer lists) for functions and constructors

100. Which of the following is true about the char type when used for textual data vs raw memory?
A) char can never be used for raw memory manipulation
B) char (and unsigned char / std::byte) are suitable for raw memory access — char is the only type permitted to alias object representation for certain low-level operations
C) char always implies ASCII text only
D) char cannot be used in pointer arithmetic
Answer: B) char (and unsigned char / std::byte) are suitable for raw memory access — char is the only type permitted to alias object representation for certain low-level operations