using fwrite(temp,sizeof(temp),1,ll)

March 3, 2011 at 23:07:37
Specs: Windows 7
gives segmentation fault error..
ll is the file pointer
temp is the node creates in the link list

See More: using fwrite(temp,sizeof(temp),1,ll)

Report •


#1
March 3, 2011 at 23:44:52
When you opened the file did you check that it returned a valid pointer to a stream?

Report •

#2
March 4, 2011 at 03:37:23
Also, fopen() expects the first argument to be a pointer. If temp isn't a pointer, pass it by address.

How To Ask Questions The Smart Way


Report •

#3
March 4, 2011 at 04:10:17
yes.....i did

Report •

Related Solutions

#4
March 4, 2011 at 08:10:48
If you checked both of those things and neither is the cause then I suggest that you run under a debugger so that you can check what is happening. Check all the variables that are being passed to the function call to make sure that they are valid.

Report •


Ask Question