I was looking at the format specifiers and noticed that %n
and %t
were listed as valid specifiers. According to the documentation, the insert a new line and a horizontal tab character, respectively.
What is the reason for these specifiers when the n
and t
escape sequences exist, and is there any reason to use the format specifiers instead of the escape sequences?
Sample code:
strftime(buf, 64, "Day %e of %B in %Y%t(%D)%n", t);
printf("%s", buf);
strftime(buf, 64, "Day %e of %B in %Yt(%D)n", t);
printf("%s", buf);
Sample Output:
Day 8 of August in 2024 (08/08/24)
Day 8 of August in 2024 (08/08/24)
1