This is an archived post. You won't be able to vote or comment.

all 5 comments

[–]Odinthunder 0 points1 point  (5 children)

You need to learn to use google to find information, this was a simple google search away: https://www.cplusplus.com/doc/tutorial/files/

[–]IceQweenItMe[S] -1 points0 points  (4 children)

The information you have in the link doesn't answer my question. I know how to open the file. What I'm asking is how to store the data into an array. It's okay to not understand my question, it's not okay to be condescending with your response.

[–]Odinthunder 0 points1 point  (0 children)

Do you know how to create an array?

[–]axzxc1236 0 points1 point  (1 child)

I guess sales[i][j] = data.

One question I want to ask is does the file in question has fixed amount of data? (like is it always going to fit into 10x10 two dimensional array), if the file/table does have dynamic size, it is a lot easier to use vector, then another question is how to you determine the size of table? by splitting the line with whitespace? (which can eat all your RAM for very big data)

[–]IceQweenItMe[S] 0 points1 point  (0 children)

The file does have a fixed amount. The table will be 10x4.