STDERR * stdout is for normal output. * stderr is for diagnostic / exception / error output. * None of this is enforced by the system. - For HW06/HW07/HW08, we have a specification. - log_▒▒▒▒(…) (functions HW06) go to stdout because we might want to compare that output to expected.txt as part of normal testing. - mu_run(…) (key function from HW07) goes to stderr because comparing "..... test passed" with expected would make no sense. * Both go to the terminal by default. * They can be redirected separately. - ./test_count_words > test_count_words.txt # redirects stdout ← REMEMBER THIS - ./test_count_words 2> test_count_words.txt # redirects stderr ← OPTIONAL INFO - ./test_count_words &> test_count_words.txt # redirects both ← OPTIONAL INFO * For HW07, we will try to be lenient. * For HW08, please make sure to follow this. * If you had a __mu_print_color(…), you may need a separate one, like __mu_print_color_stderr(…) in your miniunit.h. You also need to adjust the isatty(…) to use isatty(STDERR_FILENO). * Makefile messages that say test passed or failed should be on stderr. * STUPID WAY TO BYPASS SELF-TESTING REQUIREMENT FOR HOMEWORK. DO NOT DO THIS ON NORMAL ASSIGNMENTS $ ./test_count_words > expected.txt MALLOC(…) * malloc(…) allocates a buffer in memory (reserves space). * It's sole parameter is the number of bytes. * malloc(…) returns the address of the new buffer. * For every call to malloc(…) there must be exactly one call to free(…). * Call free(…) on the same address that malloc(…) returned. char* divider = malloc( (num_repetitions + 2) * sizeof(*divider) ); // └────────┬──────────┘ └───────┬──────┘ // number of chars number of bytes to store one char