input from text using structures
hello i'm confused on how to start creating this program. I am clear on how to open and read a text file. The objective is to read the text file that starts with first line with the first variable being how many lines of statements are in the rest of the file. second variable for how many intergers in each statement. i know "malloc" will input each inerger by how many i need. BUT how can i make the structure read how many intergers are on each line without knowing before hand the # of intergers i need. Here is an example of the text input.
3 4
Boston Starlite 300 410 400 600 JimRussel
Michigan 3Dlabs 200 120 150 300 StephenWilliams
Michigan Albros 400 420 510 550 BillCarter
and i know data structures reads like this
Code:
struct salesData sales = {"", "", 0, 0, 0, 0, ""};
when displaying data in the text file. how do i code it in the structure for the number of intergers that are randomly inputted because the numbers of intergers will increase or decrease with each different text file.
:confused: :confused: :confused: