download | new post | emilian_worker on April Mon 13th 1:34 PM - Never Expires
- #include<stdio.h>
- #include<unistd.h>
- #include<stdlib.h>
- int main(int argc, char*argv[])
- {
- int n1,s1=0;
- FILE *fis1,*fis2;
- //if(argc!=4)
- //{
- // printf("EROARE LA NR ARGUMENTE!\n");
- //xit(1);
- // }
- //printf("!! %s %s\n",argv[1],argv[2]);
- fis1 = fopen(argv[1],"r");
- fis2 = fopen(argv[2],"w");
- if(fis1==NULL || fis2==NULL)
- {
- exit(1);
- }
- while(!feof(fis1))
- {
- fscanf(fis1,"%d ",&n1);
- s1+=n1;
- }
- fprintf(fis2,"%d",s1);
- fclose(fis1);
- fclose(fis2);
- return 0;
- }
Submit a correction or amendment below. (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.