Ok, I think I got it working now. In case anyone wants to see what seems to be working code, here it is:
void compclass::addstudent(char tname[]) {
student *newstud = new student;
student...
Type: Posts; User: EDL
Ok, I think I got it working now. In case anyone wants to see what seems to be working code, here it is:
void compclass::addstudent(char tname[]) {
student *newstud = new student;
student...
Ok, well, I got it partially working now. It will add on to the top of the list and to the end of the list, but will not add any names in between. So i can add say, John, then I can add Jim, then...
Yeah, my code really makes no sense the more I look at it. I actually changed the count statement to
if (studentlist != NULL)
No luck though getting this function to work properly...
I'm having trouble figuring out how to do this. I think I'm sort of close.
void compclass::addstudent(char tname[]) {
student *newstud = new student;
student *head = studentlist;...
Hehe, let me know how it turns out. I'm curious why it's not working for you.
Maybe it's a problem with your compiler? I don't know, this seems like pretty basic C++ so I would assume it shouldn't have any problems with the code. Here is exactly what I put into my compiler....
What compiler are you using? I use Visual C++ 6.0
Hmmm, I have no idea what that error is. I just tried to compile your program, and it runs fine for me. I deleted the #define, set int ihave = 188;, and then switched the other 2 lines around.
Also, I can't really understand what you're trying to say, but Try this:
ihave -= lost;
ihave += money;
i think try deleting the #define and then set
int ihave = 188;
Hmmm, I can't really remember, but I don't think you can #define ihave and have it as an int at the same time. try
int ihave = 188;
Err, I just noticed that you had set head, prev and curr to NULL. I tried it again your way, and it works. :)
I thought that would work, as the explanation totally made sense to me, but for some reason, it still gives me that error. Actually, working on it just now, with a variation on yours, I got it to...
I'm having trouble figuring out what is wrong with my program. It compiles fine. I can seem to delete any grade in the list, except for the head. Any other grade deletes fine, and I am able to...
Hey, thanks a ton!!! :D That worked.
Sorry, I don't think I was clear enough earlier. That was my derived class, which I usually put virtual keyword in front of functions in there just in case I ever derive a class off of that class. ...
Hey, what I usually do in that case, is put a cin.ignore(); in right before the line it tends to skip. I don't know if that is good coding practice, lol. But it works. :)
Hi. I don't know if my subject really made sense, so I'll try to explain here. I have a file that contains all my classes, and in those classes are some derived classes with virtual functions in...