我正在查看1997 年发布的nmap的源代码,我注意到这段代码对我来说看起来有点奇怪:
int i=0, j=0,start,end;
char *expr = strdup(origexpr);
ports = safe_malloc(65536 * sizeof(short));
i++; /* <<<<<< */
i--; /* <<<<<< */
for(;j < exlen; j++)
if (expr[j] != ' ') expr[i++] = expr[j];
expr[i] = '\0';
Run Code Online (Sandbox Code Playgroud)
为什么你们会i++;然后i--;紧跟其后?i是0,则i++轮流i到1。在那之后,i--变成i到0。
链接到原始源代码。搜索:
i++;
i--;
Run Code Online (Sandbox Code Playgroud)
谁能解释一下这是干什么用的?
我使用IDEA调试go程序,但由于错误而退出:
Version of Delve is too old for this version of Go (maximum supported version 1.13, suppress this error with --check-go-version=false)
Run Code Online (Sandbox Code Playgroud)
我该如何添加--check-go-version=false?