Hi i have a really frustrating problem with pointers could somebody let me know what I am doing incorrectly here. Thanks
// 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
", 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();
}