Two-dimensional Matrix in C [duplicate]

0

I have a product registration in C. Products can be up to 30 characters (columns), but can be infinite in quantity (lines).

In the variable declaration, I used:

  

char products [] [30];

However, when compiling, it returns that the array size can not be empty. So if I put a number of lines,

  

char products [10] [30];

I'm statically pre-defining the quantity of products.

How to leave this number free so that the matrix auto-increments as the user enters the data?

    
asked by anonymous 05.06.2018 / 14:37

0 answers