I learned C++ last week, so now I'm working on a simple game with DarkGDK (Pacman).
I
think I have a grasp of pointers and how they work, but I can't figure out how to use dbStr():
char * temp;
//Make ghosts
for(int c = 1; c<5; c++)
{
temp = dbStr(c);
dbCreateAnimatedSprite(ghosts[c].spriteno,*temp + ".png",2,4,ghosts[c].imageno);
dbSprite(ghosts[c].spriteno,100,100,ghosts[c].imageno);
dbOffsetSprite(ghosts[c].spriteno,13,16);
dbCreateAnimatedSprite(ghosts[c].ediblespriteno,"ghostedible.png",2,1,edibleghostimageno);
delete temp;
}
This code gives an unhandled exception when the program is closed, and the sprites don't show up.
What am I doing wrong?