Changing all values of an array?

Hello, I am having a little bit of trouble with something, I have searched many forums, websites, and tutorials, but cannot find a way around this, Ok ill just jump strait into it.

Basicly, I have an array, like so:
int MapArray[MAP_HEIGHT][MAP_WIDTH] = {
{0, 0, 0, 0 },
{0, 0, 0, 0 }
};

And what I want to do is change it to this

MapArray[MAP_HEIGHT][MAP_WIDTH] = {
{0, 2, 2, 0 },
{0, 2, 2, 0 }
};

I have try'd so many things, I have a way around it but its terrible, So is there anyway to change all of the values of an array like that?
Thanks

-RetrO
Not like that. You can use memset to set all the values of an array at once but it sets them all to the same value. You're going to need to make a nested loop to go through every element in the array.
Damn :/ Ok well thanks for the fast reply, Ill just do it the long way

-RetrO
Topic archived. No new replies allowed.