c++ - How could this simple pointer equality test fail? -


  शून्य फ़ाइल मैनेजर :: CloseFile (फ़ाइल * const फ़ाइल) {for (int i = 0; i & lt; MAX_OPEN_FILES ; ++ i) {if ((_openfiles [i] == फ़ाइल) == सच) {_openFiles [i] == नल; }} ...  

_openFiles FileManager का एक निजी सदस्य है और केवल फ़ाइल * के सरणी है - जब तत्काल खिड़की में सटीक परीक्षण किया जाता है तो मुझे 1 के परिणाम!!!

संपादित करें == सच विशुद्ध रूप से एक विवेक जांच के रूप में जोड़ा गया था!

आपके पास

  _openFiles [i] == शून्य;  

होना चाहिए

<पूर्व> _openFiles [i] = नल;

?


Comments

Popular posts from this blog

c++ - Linux and clipboard -

Visual Studio 2005: How to speed up builds when a VSMDI is open? -

booting ubuntu from usb using virtualbox -