こんにちは、私はポインターに関して本当にイライラする問題を抱えています。ありがとう
// This functions reads from the file
void get__data_block_from_disk(char* ptr, int block_num){
int file_desc;
int x;
open_fs(file_path);
file_desc = fileno(fileptr);
x = lseek(file_desc, DATA_BLOCK_OFFSET + block_num*BLOCK_SIZE, SEEK_SET);
fread(&ptr, BLOCK_SIZE, 1, fileptr);
close_fs();
}
// This function writes to the file
void place__data_block_into_disk(char* ptr, int block_num){
int file_desc;
int x;
printf("char in place: %c\n", ptr);
open_fs(file_path);
file_desc = fileno(fileptr);
x = lseek(file_desc, DATA_BLOCK_OFFSET + block_num*BLOCK_SIZE, SEEK_SET);
fwrite(ptr, BLOCK_SIZE, 1, fileptr);
close_fs();
}