iOS

来源:互联网 发布:最终幻想13优化 编辑:程序博客网 时间:2024/05/21 10:22

#include<stdio.h>

   int main (void){

                  printf ("longstring.\n");

                  printf("here`s

 another way to printf a \  long string .\n") ;   

                 printf("here`s the newestway to print a""long string .\n");

  }

方法1.\n

方法2.用反斜线符号(/)和回车键组合来结束

方法3.采用字符串连接的方法,他是ANSIC的新方法,如果在一个双引号引起来的字符串后面跟有另一个双引号引起来的字符串,而且之间仅用空白字符分割,那么会把该组合当作一个字符串进行输出

Scanf()中的*提供截然不同的服务,当把他放在%和说明符字母之间时,它使函数条过相应的输出项目

 例如:scanf("%*d  %*d  %d",&n);

2.在你希望提供你自己的初始化函数的时候,你应该遵循三个步骤来保证正确性

@implementation newViewController

-(id)initWithNews:(News*)news{

   self =[super initWithnibName:nilbundle:nil];

    if(self){

       _new=news;

   }

Returnself;

 }

-(id)initWithNibName:(NSString*)nibNameOrNilbundle:(NSBundle*)nilBundleOrNil{

     return [self initWithNews:nil];

   

}

@end

3.当使用setter getter 方法的时候,应该总是;用点符号来访问以及设置属性

 view.backgroundColor =[UIColor orangeColor];

[UIApplicationshareApplication].delegate;

 

 

0 0
原创粉丝点击