有没有一种方法可以指定要输出的字符串中多少个字符(类似于ints中的小数位)?
printf ("Here are the first 8 chars: %s\n", "A string that is more than 8 chars");
想要打印: Here are the first 8 chars: A string
相关分类