PDA

View Full Version : error array


jaskiller
01/01/2012, 09:56 PM
hi I have a probleme with string array

enum cInfo
{
owner[MAX_PLAYER_NAME]
}
new carinfo[MAX_VEHICLES][cInfo]

when I do


carinfo[carid][owner] = "name";

I have error : error 047: array sizes do not match, or destination array is too small
who can help me plz

Face9000
01/01/2012, 10:09 PM
At what line you get that error?

jaskiller
01/01/2012, 10:12 PM
this line

carinfo[carid][owner] = "name";

-Prodigy-
01/01/2012, 10:17 PM
Use strcat to copy strings:strcat(carinfo[carid][owner], "name", MAX_PLAYER_NAME);

I also recommend using "strcpy" by ******. Can be found on his Optimization thread.

jaskiller
02/01/2012, 12:28 PM
ah thx in pawn it not like c#.