c++ - error C2664: 'strcmp' : cannot convert parameter 2 from 'char' to 'const char *' -


I need help about that script.

  BOOL Check (LPCSSRIs MKID) {char ClientMacs [18] = {"11: 22: 33: 44: 55: 66",}; (Int x = 0; x & lt; 10; x ++) {if (! Strcmp (macid, client mac [x]) {printf (macid, "successful!"); Back true; } } return false; }   

I'm getting

Error C2664: 'strcmp': Pointer to type 'integral' from 'const char *' conversion to 'char' Type reinterpret_cast, C-style cast or function-style cast

when I try to compile it.

not

  if (strcmp (macid, clientmax [x ]) {}   

but

  if (! Strcmp (MacID, and ClientMacs [x])) {...}   

Arg 2 is a four *, but you see it in four forms, if your argument was simple then

  the clientmax // compiler understands that this short story and client mac [0] for   

, it will be fine. But when the index is different from zero, then you have to keep the ampersand with it.

- Box

Comments