no instance of function "std::sscanf" matches the argument list

02 Aug 2011

Here's the line: sscanf(str,"%s %d %s", e,ledI,onoff)

e is a string, ledI is an int, onoff is also a string. str is initialized as: string str (inpt);

inpt is also a string.

02 Aug 2011

sscanf() is a C standard library function that is meant to work with C style strings (NULL terminated character arrays) and not C++ string objects as you have used here. You could use str.c_str() to get the C string for the str input. That isn't going to help with the e and onoff string parameters which will need to be passed in as the beginning address of character arrays large enough to hold the necessary strings. Even ledl should have its address (&ledl) and not its value passed into sscanf.