Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- int main(int argc , char *argv[4])
- {
- FILE *f,*g;
- if (argc != 4) {
- printf("Utilizare: %s <sursa> <destinatie> %d \n",argv[0],argc);
- exit(EXIT_FAILURE);
- }
- f=fopen(argv[1],"r");
- g=fopen(argv[2],"w");
- int n =atoi(argv[3]);
- char a [100];
- int i =0;
- while (fgets(a,99,f))
- {
- if(n<=i)
- fputs(a,g);
- i++;
- }
- fclose(f);
- fclose(g);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement