Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main()
- {
- FILE *soubor;
- char znak;
- soubor = fopen("znaky.txt", "r");
- while ((znak = fgetc(soubor)) != EOF)
- {
- if (znak == 'q') {
- printf("Nasel jsem znak q, koncim.");
- return 0;
- } else
- {
- switch (znak)
- {
- case '0':
- printf("Nasel jsem nulu.\n");
- break;
- case '1':
- printf("Nasel jsem jednicku.\n");
- break;
- }
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement