I have been having problems with the following code:
Code:
RndHist = Random;
printf("\nFIGHT!\n");
text[] = "Fight"; //text[] is actualy: Uint16 text[250];
display_font(225, 420, 16, 0, 0, 0);
when I compile it using my make file it spews out this error:
Code:
george@georgescomp1:~/cfiles/George Lair/050606$ make
g++ -c `sdl-config --cflags` main.cpp
main.cpp: In function ‘void FightChk()’:
main.cpp:95: error: expected primary-expression before ‘]’ token
make: *** [main.o] Error 1
george@georgescomp1:~/cfiles/George Lair/050606$
I have tried the following (the ones that are coming to mind):
text[] = {'F','i','g','h','t','\0'};
text[250] = {'F','i','g','h','t','\0'};
text[250] = "Fight";
Does this have to do with Uint16? I could not get a straight to the point answer online through google or yahoo, or at cplusplus.com or cprogramming.com. Uint16 is needed in the SDL_ttf function TTF_RenderUNICODE_Solid(font,text,color). I could probably easily use another function, but I would like to see what is going wrong with this before I move on. I have another question regarding this but I have to hit the sack and also I'm in a fog so it is not coming to mind how I phrase the question. I'll get back this tommarow.(051106)
PS: If this question was too vague, such as not enough information or if I contradict myself or etc in any way, please tell me so I can fix the problem. I do not like retarded threads/posts, but I do what I hate at times and I like to correct them.