[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

problems with gcc and fopen() in debian 2.2



Hello!

I am (re)starting in programming c (I have learned it a while ago under
dos).
Yesterday, I wrote a simple program.
When compiled with gcc -o test test.c, no errors or warnings occured.

But when I try to run, it terminates with "Segmentation fault".
So, with the help of ddd (real nice tool ;-D ) I was able to locate the
problem: fopen().

ddd reported a seg fault on the following line:

infile=fopen("dir.dat", "r");

The "dir.dat" exists (in the same directory), and infile was deklared with:
FILE *infile;

My gcc-version is 2.95.


Thanx in advance

Andreas Maresch


BTW: Is it possible to attach files to the newsletter? I don´t suppose so,
but if I am wrong, please let me know.

-- 
-- 
The checkbox said "Windows 95 or better".

So I installed Linux!

Aufgepasst - jetzt viele 1&1 New WebHosting Pakete ohne
Einrichtungsgebuehr + 1 Monat Grundgebuehrbefreiung!
http://puretec.de/index.html?ac=OM.PU.PU003K00736T0492a



Reply to: