Posted By: xbox
Array of Strings - Empty pointer error - 02/01/15 19:50
I have an array of strings defined as:
before the main function I have a handle:
at the end of my main function I have:
It compiles and runs, but immediately I'm greeted with an "Empty pointer in main" error. If I comment out the media_play line, the game runs so I know that's the line causing issue but I am at a loss as to why. Any help would be greatly appreciated.
Also, I've replaced bg_sounds[0] in the media_play with the string itself and it works but with the array it gives the error.
Code:
STRING* bg_sounds[12]; bg_sounds[0] = "song1.mp3"; ... bg_sounds[11] = "song11.mp3";
before the main function I have a handle:
Code:
var bg_handle;
at the end of my main function I have:
Code:
bg_handle = media_play(bg_sounds[0], NULL, 100);
It compiles and runs, but immediately I'm greeted with an "Empty pointer in main" error. If I comment out the media_play line, the game runs so I know that's the line causing issue but I am at a loss as to why. Any help would be greatly appreciated.
Also, I've replaced bg_sounds[0] in the media_play with the string itself and it works but with the array it gives the error.