3 ms·
fputs(stdout, string) avoids the newline too, although you'd now have to teach two functions (printf, fputs) as well as saying what "stdout" means. In a teachin
by red_admiral 9y ago
fputs(stdout, string) avoids the newline too, although you'd now have to teach two functions (printf, fputs) as well as saying what "stdout" means. In a teaching context, printf("%s", string) is probably best as printf is being used in other lines in the same file already.
- boomlinde 9y agoWhat sacrifices you are willing to make in a teaching context is a matter of taste. You draw the line somewhere between using printf in an entirely acceptable way where fputs would have been better suited, and using printf in another entirely acceptable way where fputs would have been better suited. That seems inconsistent and hard to justify.