gcc 4.4.2
I have the following code:
char channels[] = "NumberOfChannel = [2]";
sscanf(channels, "%*[^=]= %d", &chan);
I am wondering what this means. As far as I can tell. It is ignoring the equals sign.
'^ ignore the character ='
Would that be correct?
Many thanks,
The
[^=]means match a string which contains no=.This is a POSIX extension.The*means discard the matched result.(BTW, to correctly get
chanyou needsscanf(channels, "%*[^=]= [%d]", &chan);.)