/* integer_rep.c Jeff Ondich, 9 Jan 2023, originally named integers.c Modified by Tanya Amert for Fall 2023 How do integers get written to files? Compile as usual: gcc -Wall -Werror -g -o integer_rep integer_rep.c Run with no command-line arguments: ./integer_rep */ #include // Use fwrite and fprintf to output integers. int main() { // Writing ints with fwrite. Little-endian or big? int j = 25; fwrite(&j, sizeof(int), 1, stdout); j = 0xABCD; fwrite(&j, sizeof(int), 1, stdout); // Writing ints with fprintf and the %d format specifier fprintf(stdout, "%d", j); return 0; }