Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
11
Task/Jump-anywhere/C/jump-anywhere-1.c
Normal file
11
Task/Jump-anywhere/C/jump-anywhere-1.c
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
if (x > 0) goto positive;
|
||||
else goto negative;
|
||||
|
||||
positive:
|
||||
printf("pos\n"); goto both;
|
||||
|
||||
negative:
|
||||
printf("neg\n");
|
||||
|
||||
both:
|
||||
...
|
||||
1
Task/Jump-anywhere/C/jump-anywhere-2.c
Normal file
1
Task/Jump-anywhere/C/jump-anywhere-2.c
Normal file
|
|
@ -0,0 +1 @@
|
|||
goto (x > 0 ? positive : negative);
|
||||
5
Task/Jump-anywhere/C/jump-anywhere-3.c
Normal file
5
Task/Jump-anywhere/C/jump-anywhere-3.c
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
for (i = 0; ...) {
|
||||
for (j = 0; ...) {
|
||||
if (condition_met) goto finish;
|
||||
}
|
||||
}
|
||||
5
Task/Jump-anywhere/C/jump-anywhere-4.c
Normal file
5
Task/Jump-anywhere/C/jump-anywhere-4.c
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
goto danger;
|
||||
for (i = 0; i < 10; i++) {
|
||||
danger: /* unless you jumped here with i set to a proper value */
|
||||
printf("%d\n", i);
|
||||
}
|
||||
24
Task/Jump-anywhere/C/jump-anywhere-5.c
Normal file
24
Task/Jump-anywhere/C/jump-anywhere-5.c
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
char *str;
|
||||
int *array;
|
||||
FILE *fp;
|
||||
|
||||
str = (char *) malloc(100);
|
||||
if(str == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
fp=fopen("c:\\test.csv", "r");
|
||||
if(fp== NULL) {
|
||||
free(str );
|
||||
return;
|
||||
}
|
||||
|
||||
array = (int *) malloc(15);
|
||||
if(array==NULL) if(fp== NULL) {
|
||||
free(str );
|
||||
fclose(fp);
|
||||
return;
|
||||
}
|
||||
|
||||
...// read in the csv file and convert to integers
|
||||
25
Task/Jump-anywhere/C/jump-anywhere-6.c
Normal file
25
Task/Jump-anywhere/C/jump-anywhere-6.c
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
char *str;
|
||||
int *array;
|
||||
FILE *fp;
|
||||
|
||||
str = (char *) malloc(100);
|
||||
if(str == NULL)
|
||||
goto: exit;
|
||||
|
||||
fp=fopen("c:\\test.csv", "r");
|
||||
if(fp== NULL)
|
||||
goto: clean_up_str;
|
||||
|
||||
array = (int *) malloc(15);
|
||||
if(array==NULL)
|
||||
goto: clean_up_file;
|
||||
...// read in the csv file and convert to integers
|
||||
|
||||
clean_up_array:
|
||||
free(array);
|
||||
clean_up_file:
|
||||
fclose(fp);
|
||||
clean_up_str:
|
||||
free(str );
|
||||
exit:
|
||||
return;
|
||||
Loading…
Add table
Add a link
Reference in a new issue