Jump to content
  • Advertisement
Sign in to follow this  
Basiror

very strange memberfunction problem *no idea*

This topic is 4974 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi I am working on a Huffman compression class in C++ i use STL and MSVC++6.0 now today i encountered a strange problem which actually shouldn t be one heres the class definition class CHuffmanNode { public: /* here are constructors ..... */ //returns the index of the right child int getRight(){return m_iRight;}; //returns 1 if iIndex is the right child otherwise it returns 0 int isLeftOrRight(int iIndex) { return (m_iRight == iIndex); }; protected: int m_iRight; }; ok in my code i used it like this a = node.isLeftOrRight(indexofchildnode); but it always returned 0 my little work around that works looks like this if(node.getRight() == indexofchildnode) a=1; else a=0; i get no compilation errors or anything, it simply doesn t work i have already cleared all compiled files and recompiled the app completely no luck if you know whats on here let me know please maybe the compile is just mixing some refernces or screws up the function table i have no clue any ideas? thx

Share this post


Link to post
Share on other sites
Advertisement
seems like it was a bug in the msvc++ environment

i did "rebuild all"
it recompiled and i got this problem mention above

now i deleted this function out of the code
"rebuild all"

reinserted it
"rebuild all"

and it works fine now

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!