I'm trying to write unit test for C code using check. However, I have stumbled over tests for void methods without return statements, which only use printf(). How can I test the output from these methods? Is there any way to redirect the output to, i.e., an array of chars I can compare? I have found some answers for Python, but none for C.