Reading integers from file and storing into array prob.

My main issue is that when I store just one value into a simple integer variable, it gives me a big negative number.
My goal is to store a file that reads like this into arrays:
1
2
3
4
2014 1 23
2012 2 15
2013 1 25
etc

Where I would have the first column in an array, the second in another and the third in third array since I am not allowed to use multidimensional.
Last edited on
it gives me a big negative number.
Did you check if file was really open?
Hm, good call on that. Just checked and it isn't opening.
Is there a specific directory when the file must be?
File should be in the project folder youre working with, assuming youre using visual studio
By default (if you supplying only filename) it should be in your executable working directory. If you are launching through command line, it is where your exec itself is, if you are launching though IDE, it is depends on IDE and its settings. Often it is where project file is.
Ohh, found it out. I wish my teacher actually went over this haha.
I had it in the base folder of the project, when the correct folder was the folder inside the base with the same name.

This was the needed folder in my case: J:\classLab\classLab
Last edited on
Topic archived. No new replies allowed.