“C variable type sizes are machine dependent.” Is it really true? signed & unsigned numbers ;

前端 未结 6 837
旧时难觅i
旧时难觅i 2020-12-11 07:18

I\'ve been told that C types are machine dependent. Today I wanted to verify it.

void legacyTypes()
{
    /* character types */
    char k_char = \'a\';

           


        
6条回答
  •  Happy的楠姐
    2020-12-11 08:10

    If you were to repeat your test on, say, a Motorola 68000 processor, you'd find you'd get different results (with a word being 16bit, and a long being 32 -- typically an int is a word)

提交回复
热议问题