Skip to main content

Practice · 2 of 3

Write Then Read

CHALLENGE
Difficulty: beginner+25 XP

Implement int echo_file(const char *path, const char *text): write text to path (mode "w"), then read the WHOLE file back and return the number of characters stored. Any open failure returns -1.

Back to lesson: Practice: File Workbench