I am using c to read and write contents of a file into other:
FILE *ptr;
status_t status;
uint32_t block_size, result;
uint32_t num_blocks;
char temp_buffer[1024];
ptr = fopen("file.RAW", "r+");
fseek(ptr, 0, SEEK_SET);
if (ptr == NULL)
return -1 ;
block_size = 1024;
// allocate memory to contain the whole file:
// temp_buffer = (char*) malloc (sizeof(char)*block_size);
num_blocks = sizeof(char);
result = fread(&temp_buffer, num_blocks, block_size, ptr);
ptr = fopen("file3.txt", "w+");
fseek(ptr, 0, SEEK_SET);
if (ptr == NULL)
return -1;
block_size = sizeof(temp_buffer);
num_blocks = sizeof(char);
fwrite(&temp_buffer, num_blocks, block_size, ptr);
status = fclose(ptr);
But when i open file3.txt i see these symbols:
ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿù`‘~ +Pg]Nñòs
Is there way to see the binary content of this file.
PS: i also tried same in python but no success