Skip to main content
Visitor II
November 12, 2006
Question

Variable Types

  • November 12, 2006
  • 2 replies
  • 661 views
Posted on November 12, 2006 at 04:59

Variable Types

    This topic has been closed for replies.

    2 replies

    javida14Author
    Visitor II
    November 10, 2006
    Posted on November 10, 2006 at 14:35

    Compilers are more efficient if the right type of variables are used. So when a variable is defined should you used

    int

    unsigned int

    or short versions of these?

    How would this behave if arm or thumb mode is chosen?

    Visitor II
    November 12, 2006
    Posted on November 12, 2006 at 04:59

    For almost all architectures, the type int is the most efficient. This rule works for ARM too. Perhaps, in some cases unsigned int can be more efficient than int, but you'll have to figure it out for yourself. Look at the code the compiler generates. ARM assembly language is not that difficult to learn.

    Regards,

    - mike