So I have to work for the first time with 2d array and I am confused. I want to load multiple lines like are in example (input), to that array.
123456
654321
123456
On array[0][0] should be 1, array[1][0] - 6 .. The most important thing is that length of line is random but in every line same and I need that number for the future.
What is the best way to do it? Thanks for every advice and please dont be harsh on me.
Thanks
Here is a very quick and dirty solution. When I was working on this you hadn't yet specified data type or max line length, so this works for any line length. The important part to note as you move forward with 2D arrays is the nested for() loops. The first half of this program simply determines the size of the array needed.
Use realloc like this