You can just call a handy function named "memset" which sets a specified memory range to a specified value. It works as follows.
Code:
char array[30];
// ... some computations...
// Now we clear our array
memset( array, 0, sizeof(array) );
Param 1: Pointer to destination
Param 2: Character to set
Param 3: Number of characters
NOTE: There are a few things to note here. An array acts like a pointer so we don't need to have the address-of operator before the name.
Here is another quick example to zero out the memory of a structure Foo..
Code:
Foo myStruct;
memset( &myStruct, 0, sizeof(Foo) );
It is located in the either one of these headers
memory.h
string.h
Also if you are using windows.h they have a handy macro named "ZeroMemory" which simply takes the first and third parameter of memset.