1
 if (1 != sscanf(line, "%s", name)) continue;

Earlier in the code we have

char line[128];

char name[128];

What's another way of writing this line using istringstream instead of sscanf?

4

1 回答 1

0
std::istringstream stream( line );
if( !( stream >> name ) )
    continue;
于 2011-10-29T00:24:05.450 回答