Question:

Working with Parallel Arrays and text file

by  |  earlier

0 LIKES UnLike

I have having a problem...I do not know how to read from a text file that contains:

Johnson 100

Gonzalez 93

...

(name and grade)

and produce it in the screen...one is a string and the other an integer...i know how to do only the integer but i can not do both...help!

 Tags:

   Report

1 ANSWERS


  1. It depends on what language you are using. If you are using Java use the StringTokenizer class with the delimiter set to a space. Then call nextToken() and in an alternating fashion parse a string and an int.

    Edit: In c++ you can use the C function strtok(), it is similar to the above.

Question Stats

Latest activity: earlier.
This question has 1 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.