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

Jennifer Davis davi0302 at algonquinc.on.ca
Tue Apr 8 14:04:01 EST 2003

Kathryn & Robert

I appreciate the help. I think I wasn't clear.  I really don't want the
answer as inevitably, this will be on my final exam.  If someone else does
my asignment for me, then I learn nothing and will not be prepared.  I
like having a GPA of 4.0 and would like to maintain it.  That being said.
I am having so much trouble getting my head around pointers in general
and linked lists in particular.

Since I returned to college, I have found things to be incredibly easy.
This for some reason isn't.  I think maybe it's because I never did
pointers on my Commodore 64 in MS Basic.

I am using two compilers.  I am using GCC 3.2 on Slackware 9.0 and
Bloodshed's Dev-C++ 5.0 beta   I tend to do my work on my Slack machine &
recompile for DOS when I submit an assignment to the instructor.  I am
glad that for iostream & fstream, it's just the .h in the
preprocessor directives that are deprecated.




> 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.
> --
> Kathryn
> _______________________________________________
> Programming mailing list
> Programming at linuxchix.org
> http://mailman.linuxchix.org/mailman/listinfo/programming

More information about the Programming mailing list