看起来像运算符优先级问题。代码*(argv+1)[i]
被评估为*((argv+1)[i])
你想要的是什么(*(argv+1))[i]
。你最好只使用argv[i][0]
.
评估 as*((argv+1)[i])
等价于*(*((argv+1)+i))
which is *(*(argv+1+i))
which is which is which is which is which is which is which is which is which is which is which is which is which is which is which is which is which is which is which is which is which is which is which is which is which is which is which is which is which is which is which is which is which is which is which is which is which is which is which is which is which is which is which is which is which is which is which is which is which is which is which is which is which is which is which is which is which is which is which is which is which is which is which is which is which is which is which is which is which is which is which is which is which is which is which is which is which is which is which is which is which is that””””””“评估 as”(也称为“as”)”等价于“评估”(“as”),*(argv[i+1])
它试图从 len+1 中挑选出参数 #1 的第一个字符。
一般来说,如果您使用下标而不是指针算术,您的代码会更清晰。不必要的指针算术最好留给求职面试中的难题。