dev/c/endian/write_int32.c

24 lines
278 B
C
Raw Normal View History

2012-03-12 19:38:23 +04:00
#include <stdint.h>
#include <stdio.h>
int main (void)
{
int32_t i = 1;
FILE *fid = fopen ("int32.out", "w+");
if (!fid) {
perror ("Failed to open int32.out for write\n");
goto end;
}
fwrite (&i, sizeof (i), 1, fid);
fclose (fid);
end:
return 0;
}