If the string is input from stdin:
scanf(" %s %d", R, &n);
then is it possible to get the length of R as a by product from scanf as it already has scanned through the input? As you can see there can be spaces in front and after words and there is a int input. Is it possible to refer to like give me the length you scanned for token, token etc. Like in perl where lots of things are caught and stored implicitly in $ variables and also there are some variables like 'errno' in C, I was wondering whether there are any tricks I might be unaware of.