Hey, when I run this code:
else if(strcmp(buffer,"#itemSprite") == 0)
{
char* sprite_filename = "";
int trans_r;
int trans_g;
int trans_b;
int width;
int height;
int numFrames;
int numCols;
int frameChangeDelay;
fscanf(file,"%s",sprite_filename);
fscanf(file,"%d",&trans_r);
fscanf(file,"%d",&trans_g);
fscanf(file,"%d",&trans_b);
fscanf(file,"%d",&width);
fscanf(file,"%d",&height);
fscanf(file,"%d",&numFrames);
fscanf(file,"%d",&numCols);
fscanf(file,"%d",&frameChangeDelay);
item->SetSprite(sprite_filename,D3DCOLOR_XRGB
(trans_r,trans_g,trans_b),width,height,numFrames,numCols,frameChangeDelay);
}
I get an error on this line: fscanf(file,"%s",sprite_filename);
that I don't have access to write to 0x0041ed5b. I'm guessing that's the address of sprite_filename, since the only other variable on that line is file, and we're not writing to it. Why am I getting this error? If I declare char* sprite_filename = "";
, shouldn't I have access to it within the same set of code brackets?