Уважаемые форумчане, подскажите, пожалуйста, в чем ошибка
int city=0,level=0,ench=0;
string prices[4];
prices[0]="30";
prices[1]="25";
prices[2]="27";
prices[3]="500";
messagebox(prices[1]);
wr(prices);
KIB_Exit:;
function wr(string cena[])
{
messagebox(cena[1]);
goto KIB_Exit;
KIB_Exit:;
}
1. mav - 13 Апреля, 2025 - 04:58:09 - перейти к сообщению
2. neba2101 - 13 Апреля, 2025 - 06:20:48 - перейти к сообщению
CODE:
int city=0,level=0,ench=0;
string prices[4];
prices[0]="30";
prices[1]="25";
prices[2]="27";
prices[3]="500";
messagebox("Первый прайс "+prices[1]);
wr(prices[1]);
KIB_Exit:;
function wr(string cena)
{
messagebox("Прайс из wr "+cena);
goto KIB_Exit;
KIB_Exit:;
}
string prices[4];
prices[0]="30";
prices[1]="25";
prices[2]="27";
prices[3]="500";
messagebox("Первый прайс "+prices[1]);
wr(prices[1]);
KIB_Exit:;
function wr(string cena)
{
messagebox("Прайс из wr "+cena);
goto KIB_Exit;
KIB_Exit:;
}
3. mav - 13 Апреля, 2025 - 06:32:42 - перейти к сообщению
Спасибо, но смысл в том, чтобы отправить в wr массив и напечатать, ну в данном случае элемент [1], а вообще, если надо будет, то, например [2]
4. neba2101 - 13 Апреля, 2025 - 11:25:43 - перейти к сообщению
mav пишет:
Спасибо, но смысл в том, чтобы отправить в wr массив и напечатать, ну в данном случае элемент [1], а вообще, если надо будет, то, например [2]
CODE:
int city=0,level=0,ench=0;
string prices[4];
prices[0]="30";
prices[1]="25";
prices[2]="27";
prices[3]="500";
messagebox("Первый прайс "+prices[1]);
wr(#prices[0]);//Передаём указатель на массив
KIB_Exit:;
function wr(string #cena)
{
messagebox("prices[1] = "+cena[1]);
messagebox("prices[2] = "+cena[2]);
goto KIB_Exit;
KIB_Exit:;
}
int city=0,level=0,ench=0;
string prices[4];
prices[0]="30";
prices[1]="25";
prices[2]="27";
prices[3]="500";
messagebox("Первый прайс "+prices[1]);
wr(#prices[0]);//Передаём указатель на массив
KIB_Exit:;
function wr(string #cena)
{
messagebox("prices[1] = "+cena[1]);
messagebox("prices[2] = "+cena[2]);
goto KIB_Exit;
KIB_Exit:;
}