Re: using hex in gcc

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 06/06/12 19:14, dhpant2806 wrote:
> i want to test some code having hex variable in gcc.how can i do it
What do you mean? Your question doesn't make much sense.
You don't have 'hex' variables. The way the values are stored is specific
to the architecture you are compiling to (just think that they are
"stored as bits").
Decimal, hexadecimal, binary, etc. is how we input them (in writing the
literals)
or output them.

I have no idea if this is what you wanted, but take a look at the
following program:

#include <stdio.h>

int main() {
    int variableA = 42;
    int variableB = 0x33;
    printf("Variable A: %d decimal - %x hexadecimal\n", variableA,
variableA);
    printf("Variable B: %d decimal - %x hexadecimal\n", variableB,
variableB);
    return 0;
}



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux