String question

I am currently writing a test grading program. It inputs a file, and uses get line to read each line. Each line includes the name of the student, and then their 15 answers (in for format of ABCD) after. I am just wondering how I can output just the name of each line. Say the first line reads

"Jane Doe ABDCAACBD.." etc.

How do I get my program to just output "Jane Doe"?

Since the tokens are separated by a space you can easily split them with strtok().

Have a look at this article.

http://www.cplusplus.com/reference/cstring/strtok/
For this program I am limited to cstring functions strlen, strcat, strncat, strcpy, strncpy, strcmp and strncmp.
Topic archived. No new replies allowed.