NO

Author Topic: Default Data Types  (Read 2340 times)

PhilG57

  • Guest
Default Data Types
« on: April 17, 2013, 08:06:06 PM »
I'm playing with some code which contains this structure -
typedef struct xxx {
   unsigned aaa[5];   /* aaa          */
   unsigned bbb;   /* bbb          */
} xxx;


Later the structure is defined (declared????) as follows -

xxx what;
and used as follows -

   what->aaa[0] = 0x12345678;
   what->bbb = 0;


Question1: what data type is "aaa"?
Question2: is "bbb" an int data type?

Thanks (again).

Offline Stefan Pendl

  • Global Moderator
  • Member
  • *****
  • Posts: 582
    • Homepage
Re: Default Data Types
« Reply #1 on: April 17, 2013, 10:15:49 PM »
One usually writes unsigned int, but some compilers allow the shorthand of using only unsigned.

For best readability I would always use unsigned int.
---
Stefan

Proud member of the UltraDefrag Development Team