my row size is fixed but the column size keeps varying all the time.That’s why I am thinking to use pointers for column level.But I am not sure how to use this feature in C.Please kindly help me.
int array[rows][columns]; //row size fixed but column size is not fixed.
If all but one dimension of your array are fixed, which is the situation that you describe, you can avoid using arrays of pointers: you could typedef a row as
int[rows], and create an array of rows, like this:Now you can pass around 2D arrays composed of
row_tarrays like this: