somealien
06-17-02, 11:50
| 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? Thanks :eek: |