[prog] C++ - linked list and segmentation fault

Kathryn Hogg kjh at flyballdogs.com
Tue Apr 8 12:33:49 EST 2003

Robert J. Hansen said:
> Free advice: I see from the fact you're using an ifstream that you're
> using C++.  C++ already has linked lists pre-made for you.  Try using
> them instead.  :)

Except that she explicitly mentioned that is for a class and in that case
we should assume that the purpose of the class is to learn how to
implement a linked list.

Personally, I think it's good to help students with questions about course
work but you aren't doing them any favors if you write it for them.

> <iostream.h> is deprecated.  <iostream> should be used for all new C++
> code.
>> #include<fstream.h>  // for file i/o
> Style:
> <fstream.h> is deprecated.  Use <fstream> instead.

You are assuming that she is using a compiler which has std streams. She
probably does but you never know.


More information about the Programming mailing list