|
-
Oct 15th, 2002, 12:04 PM
#1
Thread Starter
Fanatic Member
linked lists and c-style string question
hello
if i had
NODE *first;
NODE *current;
current = first;
free(current);
will that erase first, or just the pointer to current?
and if i did free(first); then that will erase it right?
same thing with erasing a linked list, if i did
while(first->next!=NULL)
first=first->next
free(first)
that will end up erasing the list right?
now about string
if i had
char *mystring="blah\x00";
char *str2 = mystring;
free(str2);
i can still access mystring? like, will it only free the str2 pointer and not delete mystring?
im kinda confused about those, i think i have a few memory leaks in my program, i just wanna make sure so i dont go around freeing things that i shouldnt
thanks
Visit www.fragblast.com
Gaming, forums, and a online RPG/Battle system
(__Flagg) DOT NET? is this a Hindi Dating service?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|