0

I have a string ive read from a file using fgets and want to only scan the last word in that string. For example if my string is

Hello my name is fred

I would only want to read the word 'fred'

I know i could just use sscanf("%s %s %s %s %s", . . . . . .) but that seems unnecessary as i only need the last value. Can this be done using sscanf?

Jack Johnson
  • 15
  • 1
  • 1
  • 4

0 Answers0