Is there an easy way to find out how many %d's, %s's are in a string.
For example:
count_specifier("arg1: %d, blah %d %s %s\n");
Should return 4.
Is there a function that does this already? I heard there was, but does anyone else know about this? I could do it the brute force way and count %'s, but I wanted to know if there was a more eloquent solution. Many thanks in advance.
For example:
count_specifier("arg1: %d, blah %d %s %s\n");
Should return 4.
Is there a function that does this already? I heard there was, but does anyone else know about this? I could do it the brute force way and count %'s, but I wanted to know if there was a more eloquent solution. Many thanks in advance.