I have a great application that I'm working on in C ++, and we have a class in which the built-in functions return the wrong value. It looks like they are offset by one record.
Here is an example code setup:
class Test { private: uint myVal1; uint myVal2; uint myVal3; uint myVal4; public: uint myFunct1() const { return myVal1 }; uint myFunct2() const { return myVal2 }; };
What we see is that myFunct1 returns myVal2, and myFunct2 returns myVal3. If I do not perform the functions, everything works as expected.
Any ideas on why this is happening?
Thanks in advance.
(I assume that what you posted above is actually a snippet from some header file.)
, , , . - - .
Test , . Test , , . - .
Test
- , , , . "" ( ), , , . .
, .
PS , - , .
"" , (.. "" #ifdef/#endif). #define - - , , .
#ifdef
#endif
#define
, () , . , - , , . , ?
Source: https://habr.com/ru/post/1790843/More articles:log output control - erlangStrtolower function in php windows-1254 encoded - stringjQuery: add once and stop (worked in older versions) - jqueryHow can I add code reuse to my Selenium tests? - seleniumDLL failure detection in C / C ++ - c ++Erase Swing title bar / panel and display a new panel - javagoogle calendar api start-min / start-max does not return the correct values - jsonБыстрый поиск, если слово существует в текстовом файле словаря - performanceIs there a case where window.location will not work in the browser? (except js off) - javascriptThe complexity of averaging the sorting algorithm - performanceAll Articles