Weird Problem about Arrays !!! Somebody tell me what's going on please..
#4

Quote:
Originally Posted by Juvanii
Посмотреть сообщение
pawn Код:
new str[64];
format(str, sizeof(str), "Unowned House");
HouseInfo[h][HouseName] = str; // will not work
format(str, sizeof(str), "Nobody");
HouseInfo[h][HouseOwner] = str; // will not work
pawn Код:
format(HouseInfo[h][HouseName], 64, "Unowned House"); // work
format(HouseInfo[h][HouseOwner], 64, "Nobody"); // work
Otherwise there is the method of the nag :
pawn Код:
HouseInfo[h][HouseOwner][0] = 'N';
HouseInfo[h][HouseOwner][1] = 'o';
HouseInfo[h][HouseOwner][2] = 'b';
HouseInfo[h][HouseOwner][4] = 'o';
HouseInfo[h][HouseOwner][5] = 'd';
HouseInfo[h][HouseOwner][6] = 'y';

printf("%s", HouseInfo[h][HouseOwner]); // show "Nobody"
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 3 Guest(s)