English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I know char takes one byte and int takes 4 bytes, but my C++ books does not state if short takes up less memory. I am assuming is does. I know in java short takes up less memory.

2007-02-19 07:56:48 · 2 answers · asked by jhn_grz 3 in Computers & Internet Other - Computers

2 answers

Yes. Only 2 bytes.

2007-02-19 11:27:29 · answer #1 · answered by Anonymous · 0 1

A short must contain at least 16 bits, but there is no requirement
that an implementation uses only 2 bytes of storage.

Typically, it is 2 bytes, but you need to ask about specific
processors and compilers to get a definitive answer.

2007-02-19 19:26:10 · answer #2 · answered by Zarco 3 · 0 0

fedest.com, questions and answers