本文共 1672 字,大约阅读时间需要 5 分钟。
spss中个案和变量
The error: duplicate case value occurs in C programming, if there are two duplicate case values in the .
错误:如果在有两个重复的case值,则在C编程中会出现重复的case值。
Consider the below program – In this program, there are two case values, which are same. "Case 2" exists two times in the program.
考虑下面的程序–在该程序中,有两个大小写相同的值。 “情况2”在程序中存在两次。
#includeint main(void) { int choice = 2; switch(choice){ case 1: printf("Case 1\n"); break; case 2: printf("Case 2\n"); break; case 3: printf("Case 3\n"); break; case 4: printf("Case 4\n"); break; case 2: printf("Case 5\n"); break; default: printf("Case default\n"); } return 0;}
Output
输出量
prog.c: In function ‘main’:prog.c:19:6: error: duplicate case value case 2: ^~~~prog.c:10:6: error: previously used here case 2: ^~~~
How to fix?
怎么修?
To fix the error: duplicate case value in C language, either remove the duplicate case and its block or change the duplicate case value.
要解决该错误:C语言中的重复案例值 ,请删除重复案例及其块,或者更改重复案例值。
Correct code – Here, I am removing the duplicate case "Case 2" which is exist second time in the program.
正确的代码 –在这里,我要删除程序中第二次存在的重复案例“案例2” 。
#includeint main(void) { int choice = 2; switch(choice){ case 1: printf("Case 1\n"); break; case 2: printf("Case 2\n"); break; case 3: printf("Case 3\n"); break; case 4: printf("Case 4\n"); break; default: printf("Case default\n"); } return 0;}
Output
输出量
Case 2
翻译自:
spss中个案和变量
转载地址:http://fzozd.baihongyu.com/