I have the following function:
static void cmd_test(char *s)
{
int d = maxdepth;
sscanf(s, "%*s%d", &d);
root_search(d);
}
How can I achieve the same output in a C++ way, rather than using sscanf
?
I have the following function:
static void cmd_test(char *s)
{
int d = maxdepth;
sscanf(s, "%*s%d", &d);
root_search(d);
}
How can I achieve the same output in a C++ way, rather than using sscanf
?
Reads a string (which does not store anywhere) and then reads a decimal integer. Using streams it would be: