Write a Line to stdout with fputs
Choose the output stream
The donation counter already has its message. fputs(text, stdout) sends it to normal output exactly as written; it does not supply a newline. This example writes to stdout, not to a local file.
#include <stdio.h>
int main(void) {
fputs("Donations ready\n", stdout);
return 0;
}
The output is Donations ready followed by a newline. Unlike printf, fputs does not interpret percent signs as placeholders. Its first argument is the text; its second is the destination stream.
puts("Ready") adds a newline and always uses stdout. fputs("Ready\n", stdout) spells out both choices. If you omit \n from the latter, a later write will continue on the same line. The course Console is an output display, not a local shell prompt.
The standard streams do not promise persistent files. stdout is where ordinary output goes in the current environment; here it is displayed as program output. The last lesson separates these browser exercises from optional keyboard input in a local terminal.