我使用了以下链接中的代码:
我定义了这样的结构
typedef struct {
char *name; /* User printable name of the function. */
Function *func; /* Function to call to do the job. */
char *doc; /* Documentation for this function. */
} COMMAND;
Run Code Online (Sandbox Code Playgroud)
编译代码时,编译器会显示以下警告:
"函数已弃用[-Wdeprecated-declarations]"
那么如果我不能使用函数类型,我应该改变什么类型?
我有一个清单
mylist = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]
Run Code Online (Sandbox Code Playgroud)
如何打印具有指定列宽的列表
例如,我想打印column = 5然后换行
print(mylist, column= 5)
[ 1, 2, 3, 4, 5,
6, 7, 8, 9, 10,
11, 12, 13, 14, 15,
16, 17, 18, 19, 20]
Run Code Online (Sandbox Code Playgroud)
或者我想打印column = 10然后换行
print(mylist, column= 10)
[ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
11, 12, 13, 14, 15, 16, 17, 18, 19, 20]
Run Code Online (Sandbox Code Playgroud)
我知道我可以使用for循环来做到这一点,但我想知道是否有一个函数已经这样做了?