SLCleary
asked on
C++ behavior for 'while' using output from function
VS 2005, C++, WinXP SP2
I'd like the experts opinions on what the 'while' loop below does? Does it takes the result from AtPollEvent and compare against NOT being -1 and assigns that to retvalue. OR does it assign retvalue the result from AtPollEvent and then compares against NOT being -1?
AtPollEvent(connId, eventName, (EventType *)&eventValue);
return (int)eventValue;
int retvalue = 0;
while ((retvalue = AtPollEvent(id, Aname, (EventType *) &lockvalue) != -1))
Thanks for your input.
I'd like the experts opinions on what the 'while' loop below does? Does it takes the result from AtPollEvent and compare against NOT being -1 and assigns that to retvalue. OR does it assign retvalue the result from AtPollEvent and then compares against NOT being -1?
AtPollEvent(connId, eventName, (EventType *)&eventValue);
return (int)eventValue;
int retvalue = 0;
while ((retvalue = AtPollEvent(id, Aname, (EventType *) &lockvalue) != -1))
Thanks for your input.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks all. Your comments helped to understand the issue ... and gives a way forward.
Sara