#include <stdio.h> #include <string.h> int main() { const char the_text[] = "this is test text!"; // 在C 语言中输出等宽度的显示我们一般采用的是在前面加数字的方法, printf("%30s\n", the_text); // 右对齐输出,结果:" this is test text!" printf("%-30…
With GCC, I can specify __attribute__((format(printf, 1, 2))) , telling the compiler that this function takes vararg parameters that are printf format specifiers. This is very helpful in the cases where I wrap e.g. the vsprintf function family. I can…