I need to see if my string matches “hello X” where X is any int.
Basically I want to catch if its “hello 1” or “hello 100”.
How best can I do it?
Edit 0
Thanks Andrea Bergia.
I am using your code like this:
int dummy;
if (sscanf(string, "hello %d", &dummy))
/* matched */
1 Answer