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

List some of the static data structures in C?

934


Write a program to implement a round robin scheduler and calculate the average waiting time.Arrival time, burst time, time quantum, and no. of processes should be the inputs.

800


What are dangling pointers? How are dangling pointers different from memory leaks?

869


What is use of null pointer in c?

715


When should a type cast be used?

744






Is c procedural or functional?

754


What are the 5 elements of structure?

786


What are the types of operators in c?

768


What is huge pointer in c?

740


cin.ignore(80, _ _);This statement a) ignores all input b) ignores the first 80 characters in the input c) ignores all input till end-of-line d) iteration

824


What is the use of typedef in c?

750


please send me the code for multiplying sparse matrix using c

1894


What is the use of ?

790


What are the advantages of c preprocessor?

944


which of the following is allowed in a "C" arithematic instruction a) [] b) {} c) () d) none of the above

1349