objective-c 强大的布尔类型

objective-c codes:

#import <Foundation/Foundation.h>
BOOL areIntsDifferent(int thing1,int thing2)
{
if (thing1==thing2) {
return (NO);
}else{
return (YES);
}
} NSString *boolString(BOOL yesNo)
{
if (yesNo==NO) {
return (@"No");
}else{
return (@"Yes");
}
} int main(int argc,const char *argv[])
{
BOOL areTheyDifferent;
areTheyDifferent=areIntsDifferent(, );
NSLog(@"are %d and %d different? %@",,,boolString(areTheyDifferent));
areTheyDifferent=areIntsDifferent(, );
return ();
}

console:

  2013-09-13 15:06:29.452 BOOL Party[1821:303] are 5 and 5 different? No

上一篇:让淘宝链接在微信中分享,GO


下一篇:Win32中文件的操作