Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main()
- {
- FILE* alma;
- FILE* korte;
- alma = fopen("alma.txt","w");
- if(alma == NULL){
- perror(alma);
- abort();
- }
- korte = fopen("korte.txt","w+");
- if(korte == NULL){
- perror(korte);
- abort();
- }
- fprintf(alma,"%d Almafa_van_a_kertben!", 10);
- fclose(alma);
- alma = fopen("alma.txt","r");
- // fscanf(alma,"%s", szoveg);
- // printf("%d %s", szam, szoveg);
- int a,o;
- while(!feof(alma)){
- a = fgetc(alma);
- fputc(a,korte);
- }
- fclose(alma);
- fclose(korte);
- korte = fopen("korte.txt","r");
- while(!feof(korte)){
- o = fgetc(korte);
- putchar(o);
- }
- fclose(korte);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement