DEV Community

"How to create list from a grid present in a file"

I have a file containing

12
12
0 0 0 1 0 1 0 1 0 1 0 1
1 0 0 1 0 1 0 0 1 0 0 0
1 1 1 1 0 1 0 0 0 0 0 1
1 0 1 0 0 0 0 1 0 0 0 0
0 0 0 0 0 0 1 0 1 0 1 0
1 0 0 1 0 1 0 0 0 1 0 0
1 0 0 0 0 1 0 0 1 0 0 1
0 0 0 0 0 1 0 1 0 1 0 0
0 0 1 0 1 0 1 0 1 0 1 1
0 0 1 0 1 0 1 0 1 0 0 0
0 0 0 0 0 1 0 1 0 0 0 0
0 0 1 0 0 0 0 1 0 1 0 0

I just want to read the grid and store into a dynamic array.
Could anyone please help me this?

Top comments (1)

Collapse
 
yeskamal profile image
Kamal Kant Mandal ❄️🇮🇳❄️

The storage array must be 2D dynamic array