首页 > 其他分享 >OC之【指向指针的指针】

OC之【指向指针的指针】

时间:2022-12-09 15:07:15浏览次数:32  
标签:指向 int OC void changeC char NSString str 指针

#import <Foundation/Foundation.h>

void changeC(char
9;
}

void changeStr(NSString
@"123";
}

int main(int argc, const char
{

@autoreleasepool {
// char c = 10;
//
// changeC(&c);
//
// NSLog(@"%i", c);

NSString *str = @"456";

changeStr(&str);

NSLog(@"%@", str);
}
return 0;
}

标签:指向,int,OC,void,changeC,char,NSString,str,指针
From: https://blog.51cto.com/u_15907570/5925299

相关文章

  • SDWebImage的block使用
    SDWebImageManager*sSDWebImageManagersharedManager];UIImage*cachedImage=[sdManagerimageWithUrl:url];//将需要缓存的图片加载进来//如果缓存中有图片......
  • OC之【NSString字符串的其他用法】
    #import<Foundation/Foundation.h>字符串的大小写处理voidNSString*str=@"GuangDong";//转成大写NSLog(@"大写:%@",[struppercaseString]);//转成小......
  • OC之【typedef的使用】
    //#defineIntegerint//给基本数据类型起别名voidtypedefinttypedefIntegertypedefunsignedintUInteger;inta=10;Integerb=9;......
  • OC之【NSMutableString的使用】
    可变字符串的创建void//预先分配10个字数的存储空间NSMutableString*str=[[NSMutableStringalloc]initWithCapacity:10];//设置字符串内容setString:@......
  • OC之【NSArray使用】
    #import<Foundation/Foundation.h>#import"Student.h"创建一个数组void//创建一个空的数组NSArray*array=[NSArrayarray];//创建有1个元素的数组NSAr......
  • OC之【NSMutableArray的使用】
    #import<Foundation/Foundation.h>#import"Student.h"voidNSMutableArray*array=[NSMutableArrayarrayWithObject:@"1"];//添加元素addObject:@"2"];addObj......
  • OC之【@protocol协议】
    #import<Foundation/Foundation.h>@protocolStudy<NSObject>默认就是@required-(void)test3;表示必须实现的方法//虽然字面上说是必须实现,但是编译器并不强求某个类......
  • OC之【@class】
    如果是继承某个类,就要导入类的头文件@classbook.h文件:#import<Foundation/Foundation.h>Book:NSObjectintprice;@end文件:"Book.h"Book-(void)dealloc{NSL......
  • OC之【深拷贝(mutableCopy)和浅拷贝(copy)】
    文件#import<Foundation/Foundation.h>#import"Student.h"#import"GoodStudent.h"//copy语法的目的:改变副本的时候,不会影响到源对象字符串的拷贝(深拷贝)//深拷贝:内容......
  • OC之【NSNumber的使用】
    #import<Foundation/Foundation.h>void//将int类型的10包装成一个NSNumber对象NSNumber*number=[NSNumbernumberWithInt:10];NSLog(@"number=%@",number);......