FREE Subscription to Dr. Dobb’s Digest: Same Great Content, New Digital Edition
Site Archive (Complete)
Open Source
Email
Print
Reprint

add to:
Del.icio.us
Digg
Google
Furl
Slashdot
Y! MyWeb
Blink
June 01, 2005

Moving to 64-Bits

(Page 10 of 16)

June, 2005: Moving to 64-Bits

Listing 6

#include <stdio.h>
#include <inttypes.h>

struct on_disk
{
   /* ILP32|LP64 Sharing Issue: This should change to int32_t */
   long foo;
};
int main()
{
    FILE *file;
    struct on_disk data;
#ifdef WRITE
        file=fopen("test","w");
        data.foo = 65535;
        fwrite(&data, sizeof(struct on_disk), 1, file);
#else
        file = fopen("test","r");
        fread(&data, sizeof(struct on_disk), 1, file);
        printf("data: %ld\n", data.foo);
#endif
    fclose(file);
}                                                  

Previous Page | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 Next Page
RELATED ARTICLES
No Related Articles
TOP 5 ARTICLES
No Top Articles.



MICROSITES
FEATURED TOPIC

ADDITIONAL TOPICS

INFO-LINK