answersLogoWhite

0

The size of an integer is compiler-dependant. The compiler itself is machine-dependant so it could be argued they are in fact machine-dependent, however we don't write code to suit the machine, we write code to suit the compiler, even when the code is machine-dependent.

User Avatar

Wiki User

10y ago

What else can I help you with?

Continue Learning about Engineering

Maximum value of an unsigned integer is how many bytes?

Type size of an unsigned integer is compiler specific. Most compilers will provide 4 bytes, but the size can range from 2 to 8, or (again) whatever the implementation provides. Note: 1. Maximum value: UINT_MAX (in limits.h) 2. Size in bytes: sizeof (unsigned)


What is the maximum integer allowed in an integer-type variable?

That varies from each programming language. As a matter of fact, many languages do not put a limit on the maximum size of a variable. It will handle any string, integer, resource, pointer, or other type size, as long as it fits into the memory of the machine running the process.


What parameters decide the size of data type for a processor?

Some bits of machine instruction code. Of course it is platform-dependent.


What is the difference between machine dependent and code optimization?

Machine dependent code is in contrast to machine-independent, or portable, code. Optimized code is in contrast to non-optimized code. The two terms do not contrast each other; machine dependent code can be optimized or not optimized, and so can machine independent code. Machine-dependent code relies on specific characteristics of the device it was written for. For example, it might depend on an integer variable to be 16 bits in size, or on a specific memory address to gain access to special hardware features (such as, for example, a ratl-time clock or serial port). Machine-dependent code is common in embedded software, which is generally written to suit small and specialized computer systems. It can be difficult to transport this code to a different machine due to these machine dependencies. Machine independent or "portable" code contains fewer and, ideally, no such dependency. In theory, such code can be freely moved from one machine to another, provided all share support for the same programming language such as, for example, ANSI-C. In reality however, no code is truly independent. Portable code may not depend on the size of an integer variable or the memory location of a serial port chip, but will instead depend on other factors. For example, it will depend on an ANSI compliant implementation of the C programming language, and an operating system with a standard POSIX API. Code optimization, by contrast, does not necessarily introduce machine dependency. Many forms of machine dependence introduced by optimization are introduced by automated optimization steps. For example, the C compiler for machine A may be able to optimize code for this particular machine for fastest excution or smallest size (or a compromise of both). Since this hardware-dependent optimization occurs at a lower level than the C programming, it is not a concern for portability. Other optimization steps can introduce machine dependency into the source code. For example, accessing a time-critical I/O device through operating system device drivers may lead to unacceptable latencies in some application. One might then decide to accept the disadvantage of machine dependencies on this occasion in order to meet the required timing constrains. It is generally advisable to introduce such dependencies with great care and only after careful consideration, and to the smallest amount possible.


How can you find out the size of int for a particular compiler?

That' what sizeof is good for.

Related Questions

Maximum value of an unsigned integer is how many bytes?

Type size of an unsigned integer is compiler specific. Most compilers will provide 4 bytes, but the size can range from 2 to 8, or (again) whatever the implementation provides. Note: 1. Maximum value: UINT_MAX (in limits.h) 2. Size in bytes: sizeof (unsigned)


When a class is created with two integer members and one member function what is the class size?

Platform-dependent, that's what sizeof is good for.


What is the size of an integer?

An integer is any number, and since there are an infinite amount of numbers, the size of an integer is unlimited.


What is the maximum integer allowed in an integer-type variable?

That varies from each programming language. As a matter of fact, many languages do not put a limit on the maximum size of a variable. It will handle any string, integer, resource, pointer, or other type size, as long as it fits into the memory of the machine running the process.


What parameters decide the size of data type for a processor?

Some bits of machine instruction code. Of course it is platform-dependent.


How do you print size of integer?

the size of an integer is determaind by using the function "sizeof(c)",here 'c' is any integer.


What is the difference between machine dependent and code optimization?

Machine dependent code is in contrast to machine-independent, or portable, code. Optimized code is in contrast to non-optimized code. The two terms do not contrast each other; machine dependent code can be optimized or not optimized, and so can machine independent code. Machine-dependent code relies on specific characteristics of the device it was written for. For example, it might depend on an integer variable to be 16 bits in size, or on a specific memory address to gain access to special hardware features (such as, for example, a ratl-time clock or serial port). Machine-dependent code is common in embedded software, which is generally written to suit small and specialized computer systems. It can be difficult to transport this code to a different machine due to these machine dependencies. Machine independent or "portable" code contains fewer and, ideally, no such dependency. In theory, such code can be freely moved from one machine to another, provided all share support for the same programming language such as, for example, ANSI-C. In reality however, no code is truly independent. Portable code may not depend on the size of an integer variable or the memory location of a serial port chip, but will instead depend on other factors. For example, it will depend on an ANSI compliant implementation of the C programming language, and an operating system with a standard POSIX API. Code optimization, by contrast, does not necessarily introduce machine dependency. Many forms of machine dependence introduced by optimization are introduced by automated optimization steps. For example, the C compiler for machine A may be able to optimize code for this particular machine for fastest excution or smallest size (or a compromise of both). Since this hardware-dependent optimization occurs at a lower level than the C programming, it is not a concern for portability. Other optimization steps can introduce machine dependency into the source code. For example, accessing a time-critical I/O device through operating system device drivers may lead to unacceptable latencies in some application. One might then decide to accept the disadvantage of machine dependencies on this occasion in order to meet the required timing constrains. It is generally advisable to introduce such dependencies with great care and only after careful consideration, and to the smallest amount possible.


How can you find out the size of int for a particular compiler?

That' what sizeof is good for.


Is density size dependent or size independent?

size independent


What is short integer?

In computer programming, a variable can be (among other things) an integer or a long integer. An integer can be any whole number in the range of -32,768 to 32,767 A long integer can be any whole number in the range of -2,147,483,648 tp 2,147,483,647 I have never heard of an "integer" variable being called a "short integer" but it makes a kind of sense. Note: The size of integer types is platform-dependent, but usually: short: 16 bits int: 32 bits (16 in archaic systems: MSDOS OS Windows16) long: 32 bits (64 in unix64) long long: 64 bits


What are the difference between size independent and size dependent?

If something is size dependent then some important aspect of that thing is influenced strongly by its size. If something is size independent, then its size does not influence any important aspect.


What is the difference between the sub machine and a machine?

Size of the weapon and size of ammuntion it fires.