LET'S TALK TECHNICAL

This blog is intended to help people prepare for the job interviews and improve their analytical skills. We have posted difficult datastructures and algorithm questions and puzzles. Interview experiences section is for the people to post their interview experiences.Views expressed here are of their personal and the blog author doesn't take any responsibility for the same.

-

Followers

Jobs

Friday, November 9, 2007

Is the size of an Integer Platform Dependent or Architecture Dependent?

platform dependent means based on operating system architecture.
ie in some of 32 bit OS, the size of int is 2byte and in some of 64 bit OS, the size of int is 4 byte. It also varies based on the compiler used.
Example: in VC++ it is 4byte and in TC++ it is 2 byte

2 comments:

  1. Hi,
    I think the explanation is incorrect.
    If the OS is 32 bit, in the sense it is initializing the complete Advanced Features of the Processor, for eg, intel processor. 32 bits is 4 bytes, hence for an integer it is 4 bytes. For 16 bit OS, in the sense the OS is initializing the processor in 8086 mode. 16 bit is 2 bytes, hence the integer size is 2 bytes.
    Correct me if I am wrong.

    ReplyDelete
  2. Bhaskar,
    You are right.
    Keep posting the answers / correcting them.

    Thanks for correcting.

    Regards,
    KKK

    ReplyDelete

Popular Posts