And then in here Printf, hello world,
Printf("Enter two numbers to add together:");
The Printf function will write to stdout.
Will Linux be smart enough to optimize Printf?
Printf to actually do its thing.
In this line saying Printf,
The cast is necessary here, because Printf() is a variadic function, so implicit conversions don't work.
Can't simply replace Printf() because the underlying calls inside Printf()
can change with a newer version of the stdio library.
But I think it will still cost CPU and
we better define a macro for Printf so we can rewrite"Printf"(maybe just return).
And that's just a fancy way of saying Printf in C is going to be a statement
or a function that prints something to the screen.
Any time you want to print a string without a linefeed
after it, or with escapes in the string, use Printf instead(and learn how it works-- it's
more complicated than echo is).
If you really need to suppress the output depending on the program execution environment, consider setting a global flag and wrap up Printf to check the flag before printing- it isn't going to slow down the program to an extent where the performance loss is visible, as a single condition
check is much faster than calling Printf and doing all the string formatting.