I have a non-terminated string [...]
'sz' is the Hungarian prefix for a zero-terminated string. Only use it if you indeed mean what rip-off has assumed.
The problem that I am having is that when I try to compare with if() statements the result is never true.
[source lang="cpp"]if(szParam == "player") /* compare the address of szParam to the location where "player" is stored */[/source]
String literals are actually constant pointers. It isn't possible to compare them this way because
you're trying to compare two pointers and not the data they point to.
The easiest method would be to use
strncmp in the Standard C library. It obeys the rules that arkane7 stated but allows you to specify a maximum number of characters to compare.
[source lang="cpp"]if(strncmp(szParam, "player", sizeof("player")) == 0)
{
/* the two strings are equal */
}[/source]
Remember that str{n}cmp is a character-by-character check of two strings. If one string is longer than the other you'll flow over the end of the smaller string.