SA-MP Forums Archive
multi-dimensional arrays must be fully initialized - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: multi-dimensional arrays must be fully initialized (/showthread.php?tid=562752)



multi-dimensional arrays must be fully initialized - erminpr0 - 11.02.2015

Код:
new NumberNames[8][6] =
{
	{"ZERO"},
	{"ONE"},
	{"TWO"},
	{"THREE"},
	{"FOUR"},
	{"FIVE"},
	{"SIX"}
	
}; //error here
Wanna use it in this form:
Код:
new string[255]; format(string, sizeof(string), 
"0 is %s | 1 is %s | 2 is %s | 3 is %s | 4 is %s | 5 is %s | 6 is %s", 
NumberNames[0], NumberNames[1], NumberNames[2], NumberNames[3], NumberNames[4], NumberNames[5], NumberNames[6]);
Error : multi-dimensional arrays must be fully initialized, nevermind if ' { ' & ' } ' is there or not.

Thanks


Re: multi-dimensional arrays must be fully initialized - ATGOggy - 11.02.2015

Try adding one more,
pawn Код:
{"SEVEN"}
or change this line:
pawn Код:
new NumberNames[8][6] =
to
pawn Код:
new NumberNames[7][6] =
I think it's because there is an empty place in array


Re: multi-dimensional arrays must be fully initialized - Beckett - 11.02.2015

They all must be used for this to work. You're leaving the seventh one.


Re: multi-dimensional arrays must be fully initialized - erminpr0 - 11.02.2015

Yeah you're both right thanks rep+