Original Post
Hi
This is a new problem for me, ive created a class for reading and writing to my file. And a use new to allocate a new Filehandleclass.
cFilehadle *Filehandle = new cFilehandle;
this works. but I want to add filename input to the construktor.
construktor
cFilehandle(char *szFilename);
allocation
cFilehadle *Filehandle("File.hej") = new cFilehandle;
i get some weard problem.
First is there any problem with my allocation.
vc++ error.
--------------------Configuration: GameServer - Win32 Debug--------------------
Compiling...
Main.cpp
error C2059: syntax error : ''string''
error C2059: syntax error : ''string''
error C2072: ''Filehandle'' : initialization of a function
error C2512: ''cFilehandle'' : no appropriate default constructor available
error C2227: left of ''->PrintPlayers'' must point to class/struct/union
error C2541: delete : cannot delete objects that are not pointers cCommunication.cpp
error C2059: syntax error : ''string''
error C2227: left of ''->ReadPlayerData'' must point to class/struct/union cFilehandle.cpp
error C2059: syntax error : ''string''cServer.cpp
error C2059: syntax error : ''string''ServerConsole.cpp
error C2059: syntax error : ''string''
error C2227: left of ''->FindPlayer'' must point to class/struct/union
error C2227: left of ''->WritePlayerData'' must point to class/struct/union
error C2227: left of ''->CreateNewDataFile'' must point to class/struct/union
It seems that there are only errors when i use new to allocate memory.