Original Post
I have a non-terminated string of variable size, being read from a file and being copied into a buffer (see the following).
In this case szParam0=="player"
The problem that I am having is that when I try to compare with if() statements the result is never true.
if(szParam=="player") // Never equals true as szParam is a 32 byte char buffer.
Knowing that the string held in szParam can be variable length how can I use the if statement to compare against another string of text?
Any help would be greatly appreciated.
char szParam0[32];
b_file >> str;
strcpy(szParam0,str);In this case szParam0=="player"
The problem that I am having is that when I try to compare with if() statements the result is never true.
if(szParam=="player") // Never equals true as szParam is a 32 byte char buffer.
Knowing that the string held in szParam can be variable length how can I use the if statement to compare against another string of text?
Any help would be greatly appreciated.