+ 1

What it means 👇👇

int x; string str[]="abcde"; printf("%-5.*s\n",x, string)

19th Apr 2018, 9:50 AM
Naman
Naman - avatar
1 Resposta
+ 5
First, your code has bugs. x must have a value and your abcde must be a quoted string. %s states a string argument is to be printed. - requests a left justified printing within the reserved area. 5 requests 5 spots to be reserved for the string. .* an integer will be before the string to state the maximum characters to display. x of 3 will print "abc \n", with 2 spaces.
19th Apr 2018, 10:23 AM
John Wells
John Wells - avatar