2004년 5월 10일 월요일

hexa code printer

#include <stdio.h>

union shared_tag {
    unsigned long long int ull;
    unsigned char c[8];
} shared;

void print()
{
    int j = 0;

    printf("shared.ull : %llu\n", shared.ull);

    shared.ull = ull_endian_convert(shared.ull);

    printf("shared.c : ");
    for (j = 0; j < 8; j++) {
        printf("%d ", shared.c[j]);
    }

    shared.ull = ull_endian_convert(shared.ull);

    printf("\n");
}

----------------------
shared.ull에 적당한 integer값을 넣고 print() function을 call하면 된다.

댓글 없음:

댓글 쓰기