answersLogoWhite

0


Best Answer

sizeof (long) and sizeof (short)

often 4 or 8 for long, and 2 for short

User Avatar

Wiki User

13y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How many bytes does long and short data type reserve?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

Short int and long integers have how many bytes in C programming?

It depends on the programming language, the compiler, and the machine architecture. In C, the size of short int and int is not mandated by the language. Often, on 32-bit machines, 'int' will be 32-bit, while 'short int' may be 16-bit. But the only thing the language promises is that short int will be no larger than int.


What Bytes occupied by double data type in c?

The number of bytes occupied by a specific data type depends on the implementation. In general, the double data type is eight bytes long, but you can check it using sizeof(double). In 16-bit,32-bit compilers double size is 8 bytes.It looks like float because it stores scientific and financial like big float values.


State and explain any 4 predefined data types in C plus plus programming?

A char is always 1 byte long, but may be signed or unsigned depending on the implementation. Explicitly signed or unsigned char types are treated as being independent types from the implicit char type (3 separate types).A short (or short int) is at least 2 bytes long while a long (or long int) is at least 4 bytes long. Both are implementation-dependent with regard their actual size and sign, but, like char, may be explicitly signed.Char, short and long are used to store integers (whole numbers). A char can store signed values in the range -128 to +127, or unsigned values in the range 0 to 255.A double is at least 8 bytes long while its shorter counterpart, a float, is at least 4 bytes long. Both are implicitly signed, floating point values.To determine the length of any type (including predefined types) us the sizeof operator.


What is the sizeof long int?

The sizeof long int is platform-dependent, often 4 bytes or 8 bytes.


Who decides size of data types in a language?

The people who create the language take the liberty of deciding the size of data types in a programming lanauage.If you (as a programmer) create your own custom data type, for example by defining a class, then you decide what goes into it - for example, in Java, if one of the pieces of data requires an integer, you have the choice of storing it as an int, which uses 4 bytes, or as a long, which uses 8 bytes (and permits larger numbers).

Related questions

What is short and long pointer?

A short pointer typically refers to a pointer that occupies fewer bytes (usually 2 bytes), while a long pointer is a pointer that occupies more bytes (usually 4 or 8 bytes) to represent memory addresses in computer programming languages. Short pointers are more limited in the range of memory addresses they can access compared to long pointers.


How many bytes of data can 32 MB of RAM store?

A stick of 512 megabytes of RAM can hold about 512 megabytes of data. It cannot, however, store it for long because it is volatile and is not designed to store data.


What is data block?

(Data block) A series of data elements handled as one unit. Typically a data block on disk is 512 bytes long (synonymous with sector). On tape the block size is normally greater and variable. A sequence of continuous data character or bytes transmitted as a unit.


What are the four most common data types?

Common data types vary depending on the hardware, the application and numerous other factors. Therefore there can be no definitive list of the most common data types. Below are a few that are frequently found in a variety of applications: Text or string data Integer values, frequently 2, 4 or 8 bytes long Floating point numeric data, usually several bytes long Boolean data (i.e. true or false) Byte (a single byte that holds data defined by the application) Word (two bytes holding data defined by the application) There are many more data types not listed.


Short int and long integers have how many bytes in C programming?

It depends on the programming language, the compiler, and the machine architecture. In C, the size of short int and int is not mandated by the language. Often, on 32-bit machines, 'int' will be 32-bit, while 'short int' may be 16-bit. But the only thing the language promises is that short int will be no larger than int.


What are the types of operands and operation?

bytes integers long integers short integers word double word strings


What Bytes occupied by double data type in c?

The number of bytes occupied by a specific data type depends on the implementation. In general, the double data type is eight bytes long, but you can check it using sizeof(double). In 16-bit,32-bit compilers double size is 8 bytes.It looks like float because it stores scientific and financial like big float values.


State and explain any 4 predefined data types in C plus plus programming?

A char is always 1 byte long, but may be signed or unsigned depending on the implementation. Explicitly signed or unsigned char types are treated as being independent types from the implicit char type (3 separate types).A short (or short int) is at least 2 bytes long while a long (or long int) is at least 4 bytes long. Both are implementation-dependent with regard their actual size and sign, but, like char, may be explicitly signed.Char, short and long are used to store integers (whole numbers). A char can store signed values in the range -128 to +127, or unsigned values in the range 0 to 255.A double is at least 8 bytes long while its shorter counterpart, a float, is at least 4 bytes long. Both are implicitly signed, floating point values.To determine the length of any type (including predefined types) us the sizeof operator.


What is data types qulifyers?

I guess what you think of are these: short/long/long long, signed/unsigned


In main memory how many bits num variable will hold?

That depends on the programming language, and on the specific data type. Java, for example, has integers of different sizes; for example, an int uses 4 bytes, and a long uses 8 bytes. It also has shorter integer data types. Java also has different types of floating point numbers; for example, a double uses 8 bytes, and a float uses 4 bytes. Java also has classes for arbitrary-precision math (classes BigInt and BigMath); in this case, the size in memory for a number will vary, depending on the number of digits.That depends on the programming language, and on the specific data type. Java, for example, has integers of different sizes; for example, an int uses 4 bytes, and a long uses 8 bytes. It also has shorter integer data types. Java also has different types of floating point numbers; for example, a double uses 8 bytes, and a float uses 4 bytes. Java also has classes for arbitrary-precision math (classes BigInt and BigMath); in this case, the size in memory for a number will vary, depending on the number of digits.That depends on the programming language, and on the specific data type. Java, for example, has integers of different sizes; for example, an int uses 4 bytes, and a long uses 8 bytes. It also has shorter integer data types. Java also has different types of floating point numbers; for example, a double uses 8 bytes, and a float uses 4 bytes. Java also has classes for arbitrary-precision math (classes BigInt and BigMath); in this case, the size in memory for a number will vary, depending on the number of digits.That depends on the programming language, and on the specific data type. Java, for example, has integers of different sizes; for example, an int uses 4 bytes, and a long uses 8 bytes. It also has shorter integer data types. Java also has different types of floating point numbers; for example, a double uses 8 bytes, and a float uses 4 bytes. Java also has classes for arbitrary-precision math (classes BigInt and BigMath); in this case, the size in memory for a number will vary, depending on the number of digits.


How many bytes consists of ATM cell?

53 bytes long


What is the types of data?

int, but can be assigned to a short, long or char as well