Hi,
i have the following text file and i need to put inside a 2D array without knowing number of rows and columns in the text file. (i want C to count this also)
i've tried something like that:
for (int r = 0; r<2; r++)
{
for (int c = 0; c < 4; c++)
{
myFile >> spaceLayout[r][c];
}
}
but in this case the array should be preallocated. what i want is an automatically allocated array depending on the size of the text file.
the file contain something like that:
1859 1974 726 1684 3048 6243
1853 1896 763 1738 3298 6250
2011 1715 877 1647 3548 6250
2125 1769 648 1685 4213 6227
2047 1858 661 1681 4463 6247
2272 1839 486 1653 4713 6250
2219 1843 497 1616 4963 6175
1679 1420 1234 1901 5648 6234
1522 1851 1060 1817 5898 6250
thank you for your help