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


Please Help Members By Posting Answers For Below Questions

How do you define a function?

676


What is an endless loop?

923


Is there a way to switch on strings?

708


Why isn't any of this standardized in c? Any real program has to do some of these things.

756


Differentiate between ordinary variable and pointer in c.

725






What are types of preprocessor in c?

716


main() { int i = 10; printf(" %d %d %d ", ++i, i++, ++i); }

740


Is there any possibility to create customized header file with c programming language?

716


What is structure padding in c?

727


What is the explanation for prototype function in c?

649


What is the difference between local variable and global variable in c?

788


What is the newline escape sequence?

677


Who is the founder of c language?

780


How do you construct an increment statement or decrement statement in C?

862


What is c token?

714