replace C printf with streams