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?

EboMike
  • 76,846
  • 14
  • 164
  • 167
user975900
  • 77
  • 4
  • 11

1 Answers1

0
std::istringstream stream( line );
if( !( stream >> name ) )
    continue;
K-ballo
  • 80,396
  • 20
  • 159
  • 169