1

Hello every one I want to ask how to fill 2D array using pointer. I know how to fill 1D array like

*(i+array) = 0;

but if i have array like this

int array[5][10] ;
int * rowptr ;
int * colptr ;

how should I initialize my 2D array using pointers

thanks

0

1 Answer 1

1
*(*(array+i)+j) = value;

Sign up to request clarification or add additional context in comments.

2 Comments

Or, alternatively, i[array][j], which is similarly far away from the usual form: array[i][j].
The question specified "using pointers". (Of course the [] operator does use pointers.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.