|
||
|
GP Mailing List
ATXGPSIG List
|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: another clogger problem
On Fri, 6 Oct 2000, KingFish wrote:
> char *CLogger::GetLogFileName() {
>
> if(m_LogFileOpen)
> return m_LogFileName;
> else
> return "";
>
> }
> char *filename = Logger.GetLogFileName;
This is trying to assign a pointer to char(s) to the method
address Logger::GetLogFileName. Presumably you want to call
GetLogFileName thus you need:
Logger.GetLogFileName();
Coming from Pascal I made this mistake quite a bit.
> the compiler stops with following error:
>
> "error C2440: 'initializing' : 'char *(__thiscall CLogger::*)(void)'
Notice the error message is showing that you want to convert a
function (thus the '(' / ')' around the function name) to a char.
> cannot be converted into 'char *'. There is no context to convert"
> btw, what is the diffence between someclass.method and
> someclass->method ???
'->' calls a function from a pointer, '.' calls a function from an
instance.
AClass *pAClass=new AClass;
AClass aClass;
pAClass->someFunction();
aClass.someFunction();
'p->' is equivelent to '(*p).' where 'p' is a pointer.
--
Marc Hernandez
=================================================================
The GameProgrammer.Com mailing list is for the open discussion
of any topic related to the art, science, and business of
programming games. This list is especially tolerant of beginners.
We were all beginners once
To SUBSCRIBE or UNSUBSCRIBE please visit:
http://gameprogrammer.com/mailinglist.html
|
|