+ 2
error on c compiler when printing \t
i am writing a calendar script when ever i require to print the tab using \t it trow only a space https://code.sololearn.com/cGDJIN1HvlpU/?ref=app
11 ответов
+ 6
This article may help.
https://stackoverflow.com/questions/8657702/what-do-t-and-b-do
Basically don't use tabs. use printf formatting. Tabs are not well suited for formatting
+ 6
printf("%2d", 1); // two spaces
printf("%4d", 2); // four spaces
+ 6
here is another reference which is probably more helpful than the last
https://alvinalexander.com/programming/printf-format-cheat-sheet
+ 6
https://code.sololearn.com/c0Jcw3BP6lTr/?ref=app
note: you should probably do the same for the days. (not use tabs that is)
+ 6
you can do your second example like this. note the space between \b and \t (b is backspace)
https://code.sololearn.com/ckQCwKsmYGbX/?ref=app
+ 5
I do get it, this is what I mean by printf formatting
http://www.teach.cs.toronto.edu/~ajr/209/notes/printf.html#modifier
+ 1
0
you don't get the questions, i was trying to print tab using printf("\tSun\tMon\n");
but the complier not returning the correct output
0
like what can you writ a small code with will print tab for me
0
no in complir and let me see the output
https://code.sololearn.com/cGDJIN1HvlpU/?ref=app
0
thanks you