Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- main(){
- FILE *arq_teste, *arq_testeW;
- char n, r;
- arq_teste = fopen("teste.txt", "r");
- arq_testeW = fopen("teste2.txt", "w+b");
- if(arq_teste == NULL){
- printf("Erra na abertura do arquivo teste.txt.\n/");
- system("pause");
- exit(-1);
- }
- while(!feof(arq_teste)){
- fscanf(arq_teste, "%c", &n); printf("%c\n", n);
- r = fprintf(arq_testeW, "Valor: %d \n", n);
- if(r==EOF) {
- printf("Erro na gravacao!\n");
- }
- }
- fclose(arq_teste);
- system("pause");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement