Thursday, January 2, 2014

warning: assignment makes pointer from integer without a cast

posts by fanhoucheng on 2010-12-17 20:49:46 Edit
Reported the following Code Red warning: warning: assignment makes pointer from integer without a cast
Although I understand English but just do iphone development, experts expect it directly gives brother modification method ah! ! ! !

char * pwdArray [4] [4];
int bacCode = (int) [password substringToIndex: 1];; / / password after taking two
int preCode = (int) [password substringFromIndex: 2]; / / check password before two

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 hex to 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;


Reply:
char * pwdArray [4] [4]; into char pwdArray [4] [4];
Reply:
The reply was deleted at the moderator 2010-12-20 16:25:24

Reply:
Into char pwdArray [4] [4] like
Reply:
Your part of the code is not objC, almost all the c + + stuff
That much of the look of things pointer

No comments:

Post a Comment