1. The data type that size_t represents is
implementation dependent. Which are the
only data types permitted?
(Note 2.12)
A. signed char, short, int, long, long long
B. unsigned char, unsigned short, unsigned
int, unsigned long, unsigned long long
C. float, double, long double
D. char, unsigned short, unsigned int,
unsigned long, unsigned long long
E. any arithmetic data type
1) The data type that size_t represents isimplementation dependent. Which are theonly data types permitted?
Answer: B. unsigned char, unsigned short, unsigned int, unsigned long, unsigned long long.
Explanation:
Basically the type's size is chosen so that it could store the maximum size of a theoretically possible array of any type. the maximum permissible size is dependent on the compiler; if the compiler is 32 bit then it is simply a typedef for unsigned int but if the compiler is 64 bit then it would be a typedef for unsigned long long long . The size_t data type is never negative. Although size_t can store a pointer, it is better to use another unsigned integer type uintptr_t for that purpose . The types size_t and uintptr_t are synonyms. size_t type is usually used for loop counters, array indexing and address arithmetic.
Get Answers For Free
Most questions answered within 1 hours.