Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- void plik(char *nazwa){
- FILE *file = fopen(nazwa, "r");
- if(file == NULL){
- printf("Bład odczytu");
- }
- fpos_t dlugosc;
- fseek(file, 0, 2);
- fgetpos (file, &dlugosc);
- fseek(file, 0, 0);
- char ciag_znakow[dlugosc];
- fscanf(file, "%s", ciag_znakow);
- int i = 0;
- while(i < dlugosc){
- ciag_znakow[i] += 2;
- i++;
- }
- printf("%s", ciag_znakow);
- }
- int main() {
- printf("Hello, World!\n");
- plik("plik.txt");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment