Fill multidimensional array elements with 0's

Viewed 53279

I have a 2d and i want to set the elements to zero without looping all the elements

int a[100][200];

I can't initialize them at point of declaration.

12 Answers

Use

int a[100][200]={0};

This will initialize all the elements of the array with 0

Related