Pregunta de entrevista
Entrevista de Computer Engineer
-
SpaceX"What is the size of an integer on a 32-bit system?"
Respuestas de entrevistas
8 respuestas
2^32= 4 billionish ?
Anónimo en
4 byte
Anónimo en
4 bytes
Anónimo en
Reading these answers now I understand why would ask the question. According to C/C++ standards the size of an integer, regardless of any hardware limitations, is at least 16 bits; but usually the size of an integer is 32 bits. It has nothing to do with it being signed or unsigned (question asks about size, not range).
Ali en
Depends if it's signed or unsigned...
Anónimo en
Depends on the CPU and compiler. It is really arbritary how a regular integer is defined, though you must know what they chose. In Microsoft .net, a regular integer is 32-bit. In their prior Visual Studio 6, it was 16-bit. In TI Code Composer (for TI DSP chips), even a Boolean (true/false) occupied 32-bits of memory.
Anónimo en
Found excellent read: bit.ly/faang100
Anónimo en
Four? A byte is 8-bits. 8/32 = 4
Andrew Gardiner en