/* integer_rep.c Jeff Ondich, 9 Jan 2023, originally named integers.c Modified by Tanya Amert for Fall 2024 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 void write_ints(); void printf_X(); void printf_signs_and_chars(); // Use fwrite and fprintf to output integers int main() { // Lab 2, part 2a write_ints(); // Lab 2, part 2b printf_X(); // Lab 2, part 2c printf_signs_and_chars(); return 0; } void write_ints() { // Write ints with fwrite int j = 25; fwrite(&j, sizeof(int), 1, stdout); j = 0xABCDE; fwrite(&j, sizeof(int), 1, stdout); // Write ints with fprintf and the %d format specifier fprintf(stdout, "%d", j); } void printf_X() { printf("\t\t\t\t"); // add some space between the previous and this // TODO: add code for part 2b } void printf_signs_and_chars() { printf("\n\n\n\n"); // add some space between the previous and this // TODO: add code for part 2c }