C++ programming help - URGENT

dude8604

Platinum Member
Oct 3, 2001
2,680
0
0
I have a programming assignment due tomorrow that I REALLY need help on. Basically, I want to make a vector-like interface for a singly linked list. I have the [ ] operator overloaded to work with it, but if I say "list[1] = "xyz"", it doesn't work. I know that I need to overload the = operator, but I don't know how I can overload it with [ ] AND =. Any help would be greatly appreciated. Here's a link to my code if that helps.code

I posted this thread in Software and Programming too, but I really need help. Please don't flame me for doing this. I PMed the mods about this and if they say it is a problem I will get rid of this post. Thanks for your help!
 

KeyserSoze

Diamond Member
Oct 11, 2000
6,048
1
81
NM, I think I'm stupid.

I'm looking it up on the web, if I can find something.




KeyserSoze
 

Ameesh

Lifer
Apr 3, 2001
23,686
1
0
just overload it like you would normally do, dont worry that you already overloaded the "[ ]" operator.
 

dude8604

Platinum Member
Oct 3, 2001
2,680
0
0
But the problem is that I want to do something different if they do the = operator alone vs. if they do the [ ] and the = operator.
 

Ameesh

Lifer
Apr 3, 2001
23,686
1
0
Originally posted by: dude8604
But the problem is that I want to do something different if they do the = operator alone vs. if they do the [ ] and the = operator.

no, you want to do something different if there is two list nodes on either sides of the '=' sign. (think of it that way and it will make more sense) plus you should look on the internet to see an example of what the function prototype is for a overloaded '=', what i just said will make way more sense if it doesnt already.