Tag: openvms

如何在openvms中读取命令行参数来运行ac程序?

我构建了一个简单的程序,尝试打印命令行参数。 代码如下,我构建了一个可执行文件(TEST.EXE)。 int main(int argc, char *argv[]) { int i; printf(“%s\n”,argv[0]); for (i = 1; i < argc; i++) printf("argument %d: %s\n", i, argv[i]); exit (EXIT_SUCCESS); } 我尝试运行TEST.EXE并打印参数但失败。 命令RUN TEST.EXE test1 test2 : %DCL-W-MAXPARM, too many parameters – reenter command with fewer parameters 我该怎么做才能打印“test1”和“test2”?

字符串,获取和做

我正在用C做练习,但是我有一个问题,当我想重复cicle(做的时候),事实上,如果我输入1,程序再次由顶部开始,但它不会停止在gets(testo); 。 在没有解决方案的情况下,我尝试了很多方法来解决错误,有人可以帮助我吗? #include #include #include main(){ int cch, cw, i, j, w, ord, f; //counter and index char testo[80]; char alfa[50][25]; char swap[25]; do{ cch=0; cw=0; j=0; w=0; f=0; for(i=0;i<80;i++){ testo[i]='\0'; } printf("Write the text:\n"); gets(testo); //initialization 2d array for(i=0;i<50;i++){ for(j=0;j<25;j++){ alfa[i][j]='\0'; } } j=0; //Count word and characters if(testo[0]!='\0'){ cw=1; for(i=0;testo[i]!='\0';i++){ cch++; if(testo[i]==' […]