|
-
April 12th, 2007, 08:02 AM
#1
! operator confusion
MSDN says if DeviceIoControl completes successfully, the return value is non zero.
Given this code:
Code:
if(!DeviceIoControl(<parameters>)
{
<code>
}
Is this the same thing?
Code:
BOOL bSuccess;
bSuccess = DeviceIoControl(<parameters>)
if(bSuccess == 0) //function call failed
{
<code>
}
(I know this is very basic, but the ! operator always causes me great confusion,
especially when some functions succeed return is zero, and others is non-zero.)
-
April 12th, 2007, 08:07 AM
#2
Re: ! operator confusion
Code:
BOOL bSuccess;
bSuccess = DeviceIoControl(<parameters>)
if(bSuccess == 0) //function call failed
{
<code>
}
this is only true when u have return type of function DeviceIoControl is BOOL
-
April 12th, 2007, 08:12 AM
#3
Re: ! operator confusion
... but you are saying for DeviceIoControl specifically, my interpretation/code is correct?
-
April 12th, 2007, 08:13 AM
#4
-
April 12th, 2007, 08:15 AM
#5
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|