|
| leeainscough (3) | |||||||||
| Im using a STD::VECTOR referenced in a class. I have a class CCSToBOM_AttribObj with some data in it. I have another class (CCSToBOM_RefObj )with some data and a vector of CCSToBOM_AttribObj. I have a top level class with some member fuctions to put data in and print out the results that also has a vector list of CCSToBOM_RefObj. i.e A list of data, and each data also contains a list. I have sucessfully filled the CCSToBOM_RefObj class and printed the data. i.e Member function CCSToBOM_Proc::AddRef works and the first part of CCSToBOM_Proc::Save works. The problem is that the second part, adding the data for each Ref fails to work i.e CCSToBOM_Proc::AddAttrib and the second part of CCSToBOM_Proc::Save does not work. I see that in CCSToBOM_Proc::Save the itterator is not finding the CCSToBOM_AttribObj. This I think is due to the fact that when I report the size of the list after adding an item it is still saying 1 within the CCSToBOM_Proc::AddRef code. Commented out section tests the size. Im confused how the outer loop works but the inner one does not. It's probably a referencing issue?????? I have no idea whats wrong really. I'm using visual c++ 2003. Any pointers would be useful.
CODE.CPP
CODE.CPP CALLER BIT, NOT FULL CODE ETC
Thanks Lee Thanks Lee Sorry originally posted in wrong place | |||||||||
Last edited on | |||||||||
| kempofighter (525) | |
| I'm going to do you a favor and make a suggestion. First, read this. http://cplusplus.com/articles/how_to_ask/ Second, please format/beautify the code in your original editor. Copy and paste the code back into your original post. Highlight all of the code. Press the # button to the right of the edit box (this encloses it within code tags). Submit. Now your code will be readable. It's hard enough to read the question and figure out what you are asking but when the posted code is so unreadable many people will just skip by the post and not even bother with it. | |
| leeainscough (3) | |
| Thanks, It is more readable by doing that, sorry first time, Case of new-by RTFM. Thanks Lee | |
| leeainscough (3) | |||
| FIXED IT MYSELF:- It was due to the use of const_iterator instead of an basic iterator and some referencing. Code changed to:-
Hope this helps someone else. | |||
Registered users can post in this forum.
