Double pointer reference
Posted on: Thu, 04/10/2008 - 07:20
Double pointer reference
I'm wondering when inserting large link list, is there a way to point to the right page rather than searching for it everytime.
What i mean is i insert a webpage into a list and create another list under it. the problem is for every new url inside that website i have to search for the webpage all the time.
What i mean is i insert a webpage into a list and create another list under it. the problem is for every new url inside that website i have to search for the webpage all the time.
I think is there a way to do this with double pointers such as
insertpage(char *name, webpage **page)
insertURL(char *urlname, webpage *page);
so when a new page is create, the *page will be already pointing to the right page.
im finding it hard to find some good examples on double pointers.
i didn't entirely understand your problem..are you referring to pointers to pointers? I believe it is possible to use pointers to pointers. But wouldn't it be more feasible to store an offset value for an array or an array index value? You can index the page number and then pass it as an argument..