Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- char * nazwa_pliku()
- {
- int licznik = 1, c = 0; // licznik +1 dla '\0'
- char * nazwa = (char *)malloc( sizeof(char) * licznik);
- printf("Podaj nazwe pliku wejsciowego (nie zapomnij o rozszerzeniu) : \n");
- while ((c=getchar()) != '\n' && c != EOF)
- {
- nazwa[licznik-1] = c;
- licznik++;
- nazwa =(char *)realloc(nazwa, sizeof(char) * licznik);
- }
- nazwa[licznik - 1] = '\0';
- return nazwa;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement