✖ KAKI ✖ (nativegirl) wrote in cprogramming,
✖ KAKI ✖
nativegirl
cprogramming

I'm writing a simple program that will read a line and identify the first and last name as two separate variables in the same line. What would be the most effective way to do this?

I was thinking of having the scanner find the space in the line, and identify the characters BEFORE the space as the first name, and the characters after the space as the last name - but I have no idea how to go about this.

I'm using a sscanf function that reads the line. Is there a specifier that identifies spaces, or are they read the same way as characters?
  • Post a new comment

    Error

    default userpic
  • 5 comments