Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main(){
- FILE *plik;
- int n, i;
- char nazwa_pliki[20];
- char buffer[255];
- printf("Podaj liczbe plikw do wczytania: ");
- scanf("%d", &n);
- for(i = 0; i < n; i++){
- printf("Podaj nazwe pliku do wczytania: ");
- scanf("%s", nazwa_pliki);
- plik = fopen(nazwa_pliki,"r");
- if(plik == NULL){
- printf("ERROR: Prawdopodobnie wpisales zla nazwe pliku.");
- return 1;
- }
- fgets(buffer, 255, plik);
- plik = fopen("wyjscie.txt","a");
- fputs(buffer, plik);
- }
- fclose(plik);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement