It fills the array with zeros.Code:char buffer[100] = {0};
Printable View
It fills the array with zeros.Code:char buffer[100] = {0};
oh kool what if i wanted to declare each array with a different value or like do 20 with one and the rest with another how might i do that?
In that case, I would use a loop:
That'll fill up the first sixty elements with 20, and the last 40 elements with 30.Code:char buffer[100];
int i;
for (i=0;i<100;i++)
{
if (i<60) buffer[i]=20;
else buffer[i]=30;
}
ah the info is much appreciated shoulda guessed it was a loop lol