Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int readLines(char *fileName, char textTable[][80])
- {
- FILE *f=fopen(fileName,"r");
- if (f==NULL) return -1;
- for (int i=0;i<5;i++)
- {
- fgets(&textTable[i][0],80,f);
- }
- return 0;
- }
- void displayArray(char textTable[][80])
- {
- for (int i=0;i<5;i++)
- {
- fputs(&textTable[i][0],stdout);
- }
- }
- int main()
- {
- char textArray[5][80];
- if (readLines("dane.txt", textArray)==-1) printf("GOWNO");
- displayArray(textArray);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement