PDA

View Full Version : Can we make a bookmark or something in a file ?


clmlbx
01-08-2008, 12:39 AM
Can we make a bookmark or something in a file ?

so it can start reading or writing it from there

one file but divided into parts which can be easily read,write,delete or modify.

QwertyManiac
01-08-2008, 12:57 AM
Harder version:
Keep records of line numbers and seek to those points each time you want to reach it.

Easier version:
Use a database.

clmlbx
01-08-2008, 10:09 AM
How to make a database ?

amitava82
01-08-2008, 06:18 PM
lol.. you know programming right?

clmlbx
01-08-2008, 09:17 PM
little forgot ............out of touch

some like class in c++ and struct in c

but to confirm.........

dheeraj_kumar
02-08-2008, 02:00 PM
Simple version - use objects(of structure or class) to store data.
Harder version - read the pointer position where you want your "bookmark" to be and store it somewhere. Use seekg to navigate there.

clmlbx
02-08-2008, 09:10 PM
^ thanx but will be better if u can give an example

any help about this

http://www.thinkdigit.com/forum/showthread.php?t=94541 (http://www.thinkdigit.com/forum/showthread.php?p=906116&posted=1#post906116)

dheeraj_kumar
03-08-2008, 10:14 AM
simple way -
http://www.learn-programming.za.net/programming_cpp_learn09.html
harder -

read the file upto where you want the bookmark. use tellg and store the return value somewhere. when you want to go back to bookmark, use seekg(saved value)
http://www.cppreference.com/