Link to home
Start Free TrialLog in
Avatar of SLCleary
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.
SOLUTION
Avatar of farzanj
farzanj
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
sorry, forget my second statement.

Sara
Avatar of SLCleary
SLCleary

ASKER

Thanks all.  Your comments helped to understand the issue ... and gives a way forward.