1. 2进制转10进制
NSString * nb = @"110000000000000000000000000000010100000000100000";
long nice = strtol([nb UTF8String], NULL, 2);
NSLog(@"nict==%ld", nice);
2. 10进制转16进制
NSString * hexString=[[NSString alloc]initWithFormat:@"%lx”,nice];
NSLog(@“%@”,hexString);
时间: 2024-10-10 05:09:22