Is there a difference between the following two statements:
fprintf(stderr, "Hello this is something\n");
printf("Hello this is something\n");
If there is, what's the difference, and when would one be used over the other?
Is there a difference between the following two statements:
fprintf(stderr, "Hello this is something\n");
printf("Hello this is something\n");
If there is, what's the difference, and when would one be used over the other?
For your specific 2 Ines of code, no they're not the same.
printf only writes to stdout (not stderr)
You would use fprintf when you want to write to a different stream then stdout.