Is this a possible undefined behaviour? At present i am using
an integer to count the loop and fill the map, rather than an iterator..
Code://this is a std::map <int,int> myData; // loop int count myData[count] = count+1; //
Is this a possible undefined behaviour? At present i am using
an integer to count the loop and fill the map, rather than an iterator..
Code://this is a std::map <int,int> myData; // loop int count myData[count] = count+1; //
Thought for the day:FLTK: "The most fun you can have with your clothes on.""Are you sure your sanity chip is fully screwed in sir?" (Kryten)
Stroustrup:
"If I had thought of it and had some marketing sense every computer and just about any gadget would have had a little 'C++ Inside' sticker on it'"
Looks good - count doesn't change, so there is no other side effect apart from the assignment.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.