sinha_anshul26
asked on
Linking Linked List To Hard Disk
A simple linked list--
struct node{
int data;
node *next;
}
Generally when we create LL it gets created in RAM , what if I want to store it hard disk so that I can add / delete more nodes to it.
struct node{
int data;
node *next;
}
Generally when we create LL it gets created in RAM , what if I want to store it hard disk so that I can add / delete more nodes to it.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
That's right Anshu! Compiler generates the virtual memory addresses, which are mapped to a physical page address by MMU while running the application. Therefore, everytime you run the application, you will find that your pointer is pointing to a different address.
Just imagine if you store this address; it may be a garbage next time. Persistence mechanism works by storing the content; you can reconstruct the data structure while reading it back.
Hope it helps.
Just imagine if you store this address; it may be a garbage next time. Persistence mechanism works by storing the content; you can reconstruct the data structure while reading it back.
Hope it helps.
ASKER
>>Hope it helps
It Helped alot ...thank you both of you
It Helped alot ...thank you both of you
ASKER
Oh !! I choose the other way round sin_ 's answer should be Accepted and manish's assisted.
But any way thank you both for helping
But any way thank you both for helping
Not a problem! I too didn't know anything about FAT ptrs :)
ASKER
Just to confirm I got it right...
you mean to say,(In other words) that there is no way that we can store data at a specific location of the Hard disk (using pointers)?
I read somewhere that OS does this to manage files using FAT file system