• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

C++ programming help - URGENT

dude8604

Platinum Member
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!
 
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.
 
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.
 
Back
Top