ciabatta/test/test_printf.c

17 lines
351 B
C
Raw Normal View History

2022-06-16 05:15:45 +00:00
#include <stdio.h>
#include <stdlib.h>
2022-07-17 19:43:41 +00:00
#include <limits.h>
2022-06-16 05:15:45 +00:00
int main() {
2022-07-18 22:20:09 +00:00
static char str[] = "XYabcZW";
printf("|1234567890123|\n");
printf("|%13s|\n", str);
printf("|%-13.9s|\n", str);
printf("|%13.10s|\n", str);
printf("|%13.11s|\n", str);
printf("|%13.15s|\n", &str[2]);
printf("|%13c|\n", str[5]);
2022-06-16 05:15:45 +00:00
return 0;
}