how the size of an integer is decided?
- is it based on processor or compiler or OS?

Answers were Sorted based on User's Feedback



how the size of an integer is decided? - is it based on processor or compiler or OS?..

Answer / mathankumar

compiler

Is This Answer Correct ?    42 Yes 17 No

how the size of an integer is decided? - is it based on processor or compiler or OS?..

Answer / pratheeba

compiler

Is This Answer Correct ?    15 Yes 5 No

how the size of an integer is decided? - is it based on processor or compiler or OS?..

Answer / lanchai

Different hardware systems might have a different size for
an integer. you might get a different number in different
OS because the hardware running the OSes were different to
begin with. also, the "sizeof" command is actually a
compile-time command calculated by the compiler (see
wikipedia on sizeof)

So strictly speaking, its the hardware (or processor) that
determines the size of an integer.

Is This Answer Correct ?    11 Yes 2 No

how the size of an integer is decided? - is it based on processor or compiler or OS?..

Answer / guest

compiler

Is This Answer Correct ?    11 Yes 5 No

how the size of an integer is decided? - is it based on processor or compiler or OS?..

Answer / ramesh

compiler

Is This Answer Correct ?    10 Yes 6 No

how the size of an integer is decided? - is it based on processor or compiler or OS?..

Answer / akshay

compiler

if compiler is 16 bit compiler then int is of 2 bytes (turbo c)
if compiler is 32 bit then int is of 4 bytes in VC++

but for 32 bit compiler processor should be compatible i.e. of 32 bytes
so processor also decides it
again of OS
if os is 16 bit how you r going to run a 32 bit compiler on it

so a confusing question

Is This Answer Correct ?    5 Yes 2 No

how the size of an integer is decided? - is it based on processor or compiler or OS?..

Answer / sandeep

Its CPU (processor) which decides the size.

Please see the link below-
http://en.wikipedia.org/wiki/Integer_(computer_science)

Is This Answer Correct ?    2 Yes 1 No

how the size of an integer is decided? - is it based on processor or compiler or OS?..

Answer / hrishikesh

ans is compiler and not os or machine dependent or
processor b'coz u can port difft os on same processor .
when in tc it is 2
while in gcc it is 4 byte for int .
so her neither u r processor changes nor kernel as all are
originated from
UNIX.

Is This Answer Correct ?    2 Yes 1 No

how the size of an integer is decided? - is it based on processor or compiler or OS?..

Answer / mangesh

every book says it depends on machine.......some may have
same size for "int" and "long int".......
by machine they mean processor only.......
coz it cant be either compiler or OS......as they are part
of virtual...i mean software...not machine...

Is This Answer Correct ?    8 Yes 8 No

how the size of an integer is decided? - is it based on processor or compiler or OS?..

Answer / rakesh

It should be compiler, bcoz turbo c and VC hav different sizes for integer.

of course OS and processor interfere, but only for letting compiler get Installed or not... after which its compilers work.

Is This Answer Correct ?    2 Yes 2 No

Post New Answer

More C Interview Questions

What is the difference between int main and void main?

0 Answers  


how to find the binary of a number?

10 Answers   Infosys,


Define function pointers?

1 Answers  


What are the advantages of the functions?

0 Answers  


Is the below things valid & where it will be stored in memory layout ? static const volatile int i; register struct { } ; static register;

2 Answers   Lucent,






What is new line escape sequence?

0 Answers  


what wud be the output? main() { char *str[]={ "MANISH" "KUMAR" "CHOUDHARY" }; printf("\nstring1=%s",str[0]); printf("\nstring2=%s",str[1]); printf("\nstring3=%s",str[2]); a)string1=Manish string2=Kumar string3=Choudhary b)string1=Manish string2=Manish string3=Manish c)string1=Manish Kumar Choudhary string2=(null) string3=(null) d)Compiler error

9 Answers   Infosys,


What ios diff. Between %e & %f?

3 Answers   Honeywell,


There is a mobile keypad with numbers 0-9 and alphabets on it. take input of 7 keys and then form a word from the alphabets present on those keys.

0 Answers  


#include<stdio.h> main() {int i=1;j=1; for(;;) {if(i>5) break; else j+=1; printf("\n%d",j) i+=j; } }

7 Answers   HCL,


`write a program to display the recomended action depends on a color of trafic light using nested if statments

0 Answers  


4.weight conversion: Write a program that will read weight in pounds and convert it into grams.print both the original weight and the converted value.There are 454 grams in a pound.design and carry out a test plan for this program.

1 Answers   Wipro,


Categories