Error: multi-dimensional arrays must be fully initialized [REP++]
#1

Hello

I have a problem with this script
pawn Код:
#define MAX_RADIO (5)

new Radio [ MAX_RADIO ] [ 5 ] [ 120 ] = {
    { "HOT 108", "http://www.hot108.com/hot108.pls" },
    { "Radio 24/7", "http://37.187.79.56:9744" },
    { "Kiss FM", "http://80.86.106.136:80" },
    { "Radio Hot", "http://mp3.radiohot.ro:8000" },
    { "Radio Taraf", "http://radiotaraf.com/live.m3u" }
};

I received this error
pawn Код:
C:\Documents and Settings\JonnY\Desktop\radio.pwn(24) : error 052: multi-dimensional arrays must be fully initialized
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
Who can help me, i will give him REP++.
Reply
#2

PHP код:
enum rEnum{
    
rName[32],
    
rUrl[120]
};
new 
Radio[][rEnum] = {
    { 
"HOT 108""http://www.hot108.com/hot108.pls" },
    { 
"Radio 24/7""http://37.187.79.56:9744" },
    { 
"Kiss FM""http://80.86.106.136:80" },
    { 
"Radio Hot""http://mp3.radiohot.ro:8000" },
    { 
"Radio Taraf""http://radiotaraf.com/live.m3u" }
};

main()
{
    for(new 
isizeof(Radio); i++){
        
printf("Name > %s - Url > %s "Radio[i][rName], Radio[i][rUrl]);
    }

Reply
#3

Solved, i put new Radio [ MAX_RADIO ] [ 2 ] [ 120 ] and works, thanks anyway.
Reply
#4

Quote:
Originally Posted by Johnny_Ionut
Посмотреть сообщение
Solved, i put new Radio [ MAX_RADIO ] [ 2 ] [ 120 ] and works, thanks anyway.
You know that you are wasting tons of memory with that ?, that will only increase your amx size, just leave all square brackets empty
pawn Код:
new Radio [ ] [  ] [ ] = {
    { "HOT 108", "http://www.hot108.com/hot108.pls" },
    { "Radio 24/7", "http://37.187.79.56:9744" },
    { "Kiss FM", "http://80.86.106.136:80" },
    { "Radio Hot", "http://mp3.radiohot.ro:8000" },
    { "Radio Taraf", "http://radiotaraf.com/live.m3u" }
};
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)