I still don't know, when my string in c program contain null-terminated and when it doesn't contain.
Sample of my code
...
float t0 = 2.43, t1 = 3.42, t2 = 1, t3 = 10.9;
...
printf("%.2f %.2f %.2f %.2f", t0, t1, t2, t3);
...
If i use printf like in my code, does c program will automatically add null-terminated at the end of string that printed or no?
printf()will help. Theprintffunction sends the resulting output tostdout. No terminator is emitted. Or were you thinking ofsprintf()?printf, and whether it finishes with a null-terminator (which it doesn't). So far, no answer below seem to have picked up on that. My cheap-glass, out-of-round, poor excuse for a crystal ball tells me the question is eventually related to stdout redirection and whether that output adds a terminator to the target device.