Hello,
I created this function and it uses the file identifier "gamebase" created in the main function. when i try to compile it it gives an error like; error C2065: 'gamebase' : undeclared identifier
error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
error C2040: 'gamebase' : 'int' differs in levels of indirection from 'FILE *'
error C2440: 'initializing' : cannot convert from 'FILE *' to 'int'
You should also specify the line number where this error is happening
Try this:FILE *gamebase=fopen("base.txt","a+");
gamebase=fopen("base.txt","a+"); wouldn't work as this is a statement telling the computer to do something. It should be in a function. The global scope can only be used to declare functions,variable,classes,etc. But you can overcome this problem by using a compound statement where you are giving an instruction while declaring a variable and assigning it a value at the same time.