Click here to Skip to main content
15,919,613 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: read a name .left .right Pin
Chris Losinger17-May-06 10:26
professionalChris Losinger17-May-06 10:26 
GeneralRe: read a name .left .right Pin
Immunity1817-May-06 10:31
Immunity1817-May-06 10:31 
GeneralRe: read a name .left .right Pin
Chris Losinger17-May-06 10:35
professionalChris Losinger17-May-06 10:35 
GeneralRe: read a name .left .right Pin
Immunity1817-May-06 10:39
Immunity1817-May-06 10:39 
QuestionDeclarations Pin
koumodaki17-May-06 8:24
koumodaki17-May-06 8:24 
AnswerRe: Declarations Pin
David Crow17-May-06 10:06
David Crow17-May-06 10:06 
Questionhow to detect endianness of a machine ? Pin
big_denny_20017-May-06 6:50
big_denny_20017-May-06 6:50 
AnswerRe: how to detect endianness of a machine ? Pin
Chris Losinger17-May-06 7:20
professionalChris Losinger17-May-06 7:20 
<br />
        uint32_t value; <br />
        int i; <br />
        uint8_t *cptr = (uint8_t *)&value; <br />
<br />
<br />
        /* Write 0x01020304 to value in big-endian mode */ <br />
<br />
<br />
        for (i = 0; i < sizeof(uint32_t); i++) <br />
                cptr[i] = i + 1; <br />
<br />
<br />
        /* Now see how it reads back in native endian mode */ <br />
<br />
<br />
        switch (value) { <br />
        case 0x01020304:                  /* The only sensible way ;) */ <br />
                printf("32 bit int is big-endian\n"); <br />
                break; <br />
<br />
<br />
        case 0x04030201: <br />
                printf("32 bit int is little-endian about 8 bits\n"); <br />
                break; <br />
<br />
<br />
        case 0x03040102: <br />
                printf("32 bit int is little-endian about 16 bits\n"); <br />
                break; <br />
<br />
<br />
        default: <br />
                printf("I don't understand the result\n"); <br />
                break; <br />
        } <br />


google[^]


Cleek | Image Toolkits | Thumbnail maker

GeneralRe: how to detect endianness of a machine ? Pin
Jörgen Sigvardsson17-May-06 9:04
Jörgen Sigvardsson17-May-06 9:04 
GeneralRe: how to detect endianness of a machine ? Pin
Chris Losinger17-May-06 9:25
professionalChris Losinger17-May-06 9:25 
GeneralRe: how to detect endianness of a machine ? Pin
Jörgen Sigvardsson17-May-06 9:39
Jörgen Sigvardsson17-May-06 9:39 
GeneralRe: how to detect endianness of a machine ? Pin
Chris Losinger17-May-06 9:47
professionalChris Losinger17-May-06 9:47 
GeneralRe: how to detect endianness of a machine ? Pin
Trollslayer17-May-06 10:02
mentorTrollslayer17-May-06 10:02 
GeneralRe: how to detect endianness of a machine ? Pin
Jörgen Sigvardsson17-May-06 10:04
Jörgen Sigvardsson17-May-06 10:04 
GeneralRe: how to detect endianness of a machine ? Pin
cmk17-May-06 10:54
cmk17-May-06 10:54 
GeneralRe: how to detect endianness of a machine ? Pin
Jörgen Sigvardsson17-May-06 10:56
Jörgen Sigvardsson17-May-06 10:56 
GeneralRe: how to detect endianness of a machine ? Pin
cmk17-May-06 11:04
cmk17-May-06 11:04 
GeneralRe: how to detect endianness of a machine ? Pin
Jörgen Sigvardsson17-May-06 11:07
Jörgen Sigvardsson17-May-06 11:07 
GeneralRe: how to detect endianness of a machine ? Pin
Joshua Quick17-May-06 14:23
Joshua Quick17-May-06 14:23 
GeneralRe: how to detect endianness of a machine ? Pin
Jörgen Sigvardsson17-May-06 20:26
Jörgen Sigvardsson17-May-06 20:26 
GeneralRe: how to detect endianness of a machine ? Pin
Joshua Quick17-May-06 20:58
Joshua Quick17-May-06 20:58 
AnswerRe: how to detect endianness of a machine ? Pin
Peter Weyzen17-May-06 15:58
Peter Weyzen17-May-06 15:58 
QuestionProblem of RFX_Text under unicode Pin
Temp8317-May-06 6:13
Temp8317-May-06 6:13 
AnswerRe: Problem of RFX_Text under unicode Pin
Steve S17-May-06 6:43
Steve S17-May-06 6:43 
QuestionStoring data in a database.. Pin
altfell17-May-06 6:13
altfell17-May-06 6:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.