answersLogoWhite

0


Best Answer

16 bit and 32 bit are the most common values. See sizeof.

User Avatar

Wiki User

14y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

14y ago

sizeof (int)

(platform dependent, often 2 or 4)

This answer is:
User Avatar

User Avatar

Wiki User

12y ago

the size of an ant is 5 center metres long.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How many bytes are allocated to an int in C?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How many bytes are allocated when a variable is declared in union?

The total number of bytes allocated to the union will be the same number as would have been allocated if instead of the union was declared the largest member of the union. For example, if you declared: union myUnion { char c; int i; double d; } u;, then the space allocated to u will be the size of a double.


How many bytes in a const int?

The storage size of an int in C is loosely defined, and may be either 2 bytes or, more commonly, 4 bytes. Whether or not it is defined as const won't affect the size.


What is size of int value in c plus plus?

sizeof (int) will tell you (in bytes). It's often 2, 4 or 8 bytes.


How many bytes does an Boolean take in a c program?

There is no boolean in C, we usually use int/short/char to store logical values.


In c language size of data type int?

printf ("sizeof (int) is %d bytes", (int)sizeof (int)); Most likely it will be 2 or 4.


What is the data type int?

Data-type (short for integer).


What is the memory size of integer pointer?

for C: sizeof (int), often 2 or 4 bytefor Java: 4 byte


Using c change low and upper bytes order in short int value?

#include


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.


Integers need how many bits to stored in C plus plus?

It depends on the type of integer (such as long, short, int and char) and the specific implementation of C++. The only guarantee is that a char must occupy one byte (sizeof(char)==1). An int is typically 32-bits (4 bytes), but only sizeof(int) can tell you for sure.


How many bytes is a short variable?

It depends on both the programming language and the computer architecture, but it is generally assumed to be 2 bytes/16 bits.In C/C++, an implementation may decide to skip shorts as a separate type and make the short the same as an int, normally 4 bytes/32 bits.See related link for some more details.


What is the code to delete variables that are dynamically allocated?

In C++, dynamically allocated variables are best encapsulated in a class. In this way, the variable is automatically deleted when the object falls from scope. #include<iostream> class f () { int* p; public: f (const int i=0): p {new int{i}} {} f (const& f other): p {new int{*other.p;}} {} ~f() {delete p; } f& operator=(const f& other) { *p = *other.p; } f& operator= (const int i) {*p=i;} operator int () { return *p; } }; int main() { { f value = 42; // use value... } // f automatically falls from scope here, releasing the memory allocated to value.p }