本帖最后由 山涧小草 于 2014-8-10 19:30 编辑  
- #import<Foundation/Foundation.h>
 
 - BOOL areIntDifferent (int th1,int th2)              //此处BOOL是不是相当于C中的int 、char等类型符?
 
 - {
 
 -     if (th1==th2) {
 
 -       return (NO);
 
 -     }else{
 
 -       return (YES);
 
 -      }
 
 - }
 
 - NNString *boolString (BOOL yesNO)
 
 - {
 
 -     if(yesNO==NO) {
 
 -        return (@"NO");           //此处加@就是直接打印输出吗??
 
 -      } else {
 
 -        return (@"YES");
 
 -      }
 
 - }
 
 - int main ( int arge ,const char *argv[ ])    //为什么主函数还要定义两个变量,好像函数内部没有用着?const什么作用?
 
 - {
 
 -      BOOL areTheyDifferent;
 
 -      areTheyDifferent=areIntsyDifferent (5,5);
 
 -      NSLog(@"are %d and %d different ?%@",5,5, boolString(areTheyDifferent));  //这里%@的作用是什么?
 
 -      reture (0);
 
 - }
 
  
 
 
 
 
 
  复制代码 
 
 |