I have a newbie-ish problem (not that I'm a newbie)
I'm using the strcmp function for like the 1st time and i get this error:
I'm using the following variables in the following call to strcmp():Code:error C2664: 'strcmp' : cannot convert parameter 2 from 'char' to 'const char *'
Its probably becuase the first is declared as a single char and the other is declared as an array of chars of size MAX_PATH (defined somewhere else). The question is: what do I do to dodge this obstacle? I've tried this:Code:char bo = 'b'; char must_be_str = bo; char entered[MAX_PATH]; if(strcmp(entered, must_be_str) == 0) { // whatever }
but when I do this, its still doesn't work. Any ideas? BTW, the 'entered' variabled is taken from a TextField using GetDlgItemText.Code:char bo[MAX_PATH]; bo[0] = 'b'; char must_be_str = bo; char entered[MAX_PATH]; if(strcmp(entered, must_be_str) == 0) { // whatever }
Thanks![]()



LinkBack URL
About LinkBacks
)




Have a nice day.