[Ajuda] Qual a maneira certa de usar isso?
#1

Olб, eu estou criando um pequeno sistema, quando cheguei numa parte e travei, estou com um erro e nгo consigo resolver. Qual seria a maneira correta de usar esse cуdigo?

CarData[i][carPlaca] = GetRandomString(7);

Do jeito acima estб dando isso: error 047: array sizes do not match, or destination array is too small
Reply
#2

Pense um pouco: Link
Reply
#3

Quote:
Originally Posted by F1N4L
Посмотреть сообщение
Pense um pouco: Link
Uй, mais na CarData tб assim:
Код:
carPlaca[120],
E no GetRandomString(Й um cуdigo do IpsBruno que eu achei):
Код:
stock alfabeto [ 1 + ('z' - 'a') ] = { 'a', 'b', ...}  ;
stock numeros [ 1 + ('9' - '0') ] = { '0', '1', ...}  ;


stock GetRandomString(size = 0xff)
{
    static stringBuff[0xff];

    if(size < 0xff && size) {

        for(new i; i != size; i++) stringBuff[i] = bool: random(2) ? numeros [random(sizeof numeros )] : alfabeto [random(sizeof alfabeto )];

        stringBuff[size] = EOS;
    }

    return stringBuff;
}
Reply
#4

Alguйm?
Reply
#5

Substitui o
Код:
carPlaca[120],
para
Код:
carPlaca[255],
Reply
#6

tente:
format(CarData[i][carPlaca], 120 , "%s", GetRandomString(7));
Reply
#7

Quote:
Originally Posted by willttoonn
Посмотреть сообщение
tente:
format(CarData[i][carPlaca], 120 , "%s", GetRandomString(7));
Compilou, valeu! Vou sу testar.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)