error 047: array sizes do not match, or destination array is too small
#5

Quote:
Originally Posted by admantis
Посмотреть сообщение
It is because..
pawn Код:
Reports[MAX_REPORTS-1] = string;
/* This is a 'dinamic string size', and will return 'array sizes don't match' because MAX_REPORTS is defined as 9. 9-1 = 8, and 8 != 9.

Since the specified size would be 8 and MAX_REPORTS is 9, the sizes don't match, gives that error.*/
Got the spin? I am not sure if I explained good, or what I said is true, just guessing.
Use format() or [L3th4L]'s solution.



It is MAX_REPORTS(9)-1 (which is 8 )
Where did you get that from? I don't see it in any of the code he posted. Also I'm not sure I understand you either, I've compiled this just fine:

pawn Код:
#include <a_samp>

#define MAX_REPORTS 9

new Reports[MAX_REPORTS][128];
new string[128];

main()
{
    Reports[MAX_REPORTS - 1] = string;
}
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)