English

Enlist different built-in data types in C++ with their size. - Computer Science 1

Advertisements
Advertisements

Question

Enlist different built-in data types in C++ with their size.

Very Long Answer
Advertisements

Solution

Built-in Data Types in C++ and Their Sizes:
Data Type Size (in Bytes)
char/signed char/unsigned char 1
int/signed int/unsigned int 2
short int/signed short int/unsigned short int 2
long int/unsigned long int 4
float 4
double 8
long double 10
void 0 (No value/size)
  • The Modifiers: The text explains that signedunsignedlong, and short are modifiers applied to the basic types (int and char) to change their range or size.
  • The “void” type: While listed as a built-in type in Figure 3.1, it is used for functions that do not return a value and therefore does not have a size in bytes listed in the table.
  • Compiler Context: The table shows int as 2 bytes. This is typical for older 16-bit systems (like Turbo C++). In most modern 32-bit or 64-bit systems, a standard int is usually 4 bytes.
shaalaa.com
  Is there an error in this question or solution?
2025-2026 (March) Official Board Paper
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×