Sure, that was because the variables defined inside an 'if', or inside any loop, are local variables, and can only be 'seen' inside that loop or if.
I see you have defined
at the beginning of the code. Now this variable is a global one, and can be used anywhere.
But later you wrote:
while(!strcmp(file_data,"[SOURCES]") == 0)
{
char* file_data = dbReadString( 1 );
...
That 'char* file_data' defines a new variable, with the same name than the global one. Bad practice in any case.
I guess you wanted to say:
file_data = dbReadString( 1 );
to keep on using the global variable. Otherwise, inside the loop, the local one is the one used, and the 'while' is probably checking the global one.
One C/C++ basics is that when using arrays, the name of the array holds the pointer to the array, that is, in this case 'file_data' is already a pointer of type 'char*'.
[Edit: Lol, you shouldn't edit your posts that way, now where stands what I said, lol]