以下红色代码报警告:warning: assignment makes pointer from integer without a cast
我虽然看懂英文但是刚刚搞iphone开发,小弟实在期待高手直接给出修改方法啊!
char *pwdArray[4][4];
int bacCode =(int) [password substringToIndex:1]; ; // 取密码后二位
int preCode =(int) [password substringFromIndex:2]; // 取密码前二位
int checksum1 = 0;
int checksum2 = 0;
bacCode <<= 1;
preCode <<= 1;
for (int y = 0; y < 2; y++) {
for (int x = 0; x < 4; x++) {
pwdArray[1 – y][3 – x] = (char) (preCode & 0x1); // 0x1 16进制 为1
checksum1 ^= preCode & 0x1;
preCode >>= 1;
pwdArray[3 – y][3 – x] = (char) (bacCode & 0x1);
checksum2 ^= bacCode & 0x1;
bacCode >>= 1;
[[NSString alloc] initWithFormat:@”%d”, y];
/*
NSLog(@”*******************”);
NSLog([[NSString alloc] initWithFormat:@”%d”, y]);
NSLog([[NSString alloc] initWithFormat:@”%d”, x]);
NSLog([[NSString alloc] initWithFormat:@”%d”, checksum1]);
NSLog([[NSString alloc] initWithFormat:@”%d”, checksum2]);
NSLog(@”*******************”);
*/
}
}
pwdArray[1][3] = (char) checksum1;
pwdArray[3][3] = (char) checksum2;