As your program is growing I agree with FurryGuy that a struct is a good idea unless you want to build a class.
Right now you are more familiar with how the information is stored in the file. When I tried to break up the first two lines this is the way I see it:
************* Line 1 ****************
1 1383266NaN0000 39
1 grid
1383266 ?
0 ?
0000 ?
39 country code
************* Line 2 ****************
1 1383267000000 0 0.02730046487718618
1 grid
1383267000000 ?
0 country code?
0.02730046487718618 ?
Not sure if I am understanding this right or if it needs broken down more or differently? To me line 2 is missing a proper country code because I do not believe that zero is correct.
Line 2 is short and ends with a large decimal number that I am not sure what it is for or how to deal with it.
Once I better understand what the numbers mean I can set up a struct to put the information in.
The following is in order of columns:
Square ID(GRID ID), Time Interval, Country Code, SMS In Activity, SMS Out Activity, Call In Activity, Call Out Activity, Internet Traffic Activity. As you can see in the above, the sample I posted from the file has one long decimal value out of column alignment and in the text file there are a lot of them that are out of alignment with their respective columns. I want to align them into their respective columns and if perhaps have each column in their own (array or vector)? There is a total of 512 rows and 8 columns. I tried to create a function to fix the data but this is what I came up with and wasn't working.
I know the return type is supposed to be of type int but I have no idea what to return.
All variables declared outside the function.
si=Sqaure ID
ti=Time Interval
cc=Country Code
smsi=SMS In
smso=SMS Out
ci=Call In
co=Call Out
ita=Internet Traffic Activity