var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: seg faults in C
I'm trying to write a C program but it keeps giving me seg-faults. I tracked down the error to a line where i'm opening up a file for reading:
file_in = fopen(input_file,"r");
(file_in is of type FILE and input_file is a string with the name of the file inside of it).
the weirdest thing is that this same exact code works in a different part of my code... both are in the same method though ... could that be it?
has anyone had this problem before? do you know how to get rid of this annoying seg-fault?
hard to tell without the complete code, but a few thoughts:
file_in should be a pointer to FILE, not FILE itself.
does input_file point to a valid string (i.e. has a \0 within the allocated segment) at the point of the call or is maybe even null?