how the size of an integer is decided?
- is it based on processor or compiler or OS?
Answer Posted / vishal
In this case,
Processor : now if we consider size of ALU (16 bit or 32
bit) then int size get differed.
OS: in case of OS size of int varies in windows & linux.
Compiler : In case of compiler, C compiler has size of int 2
bytes while on same OS & processor Java compiler has 4 bytes
Finally conclusion is as per operation capacity of ALU,
operating systems are designed.
while in case of compiler i think they work in somewhat
upper layers so it doesn't matter with internal operation.
Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
How can I determine whether a machines byte order is big-endian or little-endian?
Explain how can I pad a string to a known length?
When can a far pointer be used?
Explain how do you override a defined macro?
What is a global variable in c?
string reverse using recursion
Is int a keyword in c?
What is the meaning of c in c language?
How can you determine the size of an allocated portion of memory?
What is the explanation for modular programming?
What is a shell structure examples?
Explain how can I prevent another program from modifying part of a file that I am modifying?
Is null equal to 0 in sql?
What is the 'named constructor idiom'?
What is function prototype in c language?