我喜欢C中的指针符号而不是数组符号,但在某些情况下无法弄明白.我有以下代码,以及正文main
/*converts arguemnt to number using atoi()*/
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char **argv) {
int i, times;
if(argc < 2 || (times=atoi(argv[1])) < 1) {
printf("Usage :%s positive-number\n", argv[0]);
} else {
for(i = 0; i < times; i++) {
puts("Hello");
}
}
return 0;
}
Run Code Online (Sandbox Code Playgroud)
我将如何表达argv[1]和argv[0]指针表示法?