M
Marcus
I'm struggling with a bit of code that maybe some of you could help me
understand. This code processes character values from streaming data.
I'm trying to get my head around being able to get at the values of a
const char as opposed to a char variable. The code is below:
void GotLevel(const char *szLL, char MM)
{
char ss[1024];
_snprintf(ss, sizeof(ss)
, "%s %c"
, szLL, MM
The characters then get passed to a message window. The problem is when
I try to filter for certain characters. I have no problem doing that
with "char MM"... I can just use:
if(MM == 'B')
However, I can't use the same method for the szLL const char...
if(szLL == 'NYT')
I receive an error message from the compiler: '==' : 'const char *'
differs in levels of indirection from 'int'. How could I go about
filtering for the const char? I'm not understanding something here, so
if anyone sees the error in my logic, please let me know what it might
be. Any help would be very much appreciated.
Best regards,
Marcus
understand. This code processes character values from streaming data.
I'm trying to get my head around being able to get at the values of a
const char as opposed to a char variable. The code is below:
void GotLevel(const char *szLL, char MM)
{
char ss[1024];
_snprintf(ss, sizeof(ss)
, "%s %c"
, szLL, MM
The characters then get passed to a message window. The problem is when
I try to filter for certain characters. I have no problem doing that
with "char MM"... I can just use:
if(MM == 'B')
However, I can't use the same method for the szLL const char...
if(szLL == 'NYT')
I receive an error message from the compiler: '==' : 'const char *'
differs in levels of indirection from 'int'. How could I go about
filtering for the const char? I'm not understanding something here, so
if anyone sees the error in my logic, please let me know what it might
be. Any help would be very much appreciated.
Best regards,
Marcus