-2

I want to initialize a 2D array size say a[x][y] where I will be taking x and y as inputs. Is this possible? Because I guess you need a constant integer to initialize an array. Cheers.

1 Answers1

2

in definition of array you must use number, you can't define an array with dynamic size; it is limitation of array.

but you can use new and advanced data structures like vector,list,map,set,...

Mohsen Bahaloo
  • 257
  • 2
  • 2