Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- char tekst[100],nazwa[100];
- printf("Podaj nazwe pliku jaki chcesz utworzyc z rozszerzeniem .txt\n");
- gets_s(nazwa,100);
- printf("Podaj tekst ktory chcesz zapisac w pliku\n");
- gets_s(tekst, 100);
- FILE *wp;
- if ((wp = fopen(nazwa, "w")) == NULL) {
- printf("Cos poszlo nie tak");
- exit(1);
- }
- fprintf(wp,"%s", tekst);
- fclose(wp);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement