user11152: How do I empty all the values inside a variable char array[256];?
I tried a for loop assigning an empty value at each iteration, but it doesn't compile.

user7859: char array[256];

...

int i;
for( i=0; i<256;i++ ) {
    array[i] = 0x00;
}


user4143: There is a single-line command you can use:
memset(array, 0, 256);


11152: <p>How do I empty all the values inside a variable <code>char array[256];</code>?</p>

<p>I tried a for loop assigning an empty value at each iteration, but it doesn't compile.</p>
 7859: <pre><code>char array[256];

...

int i;
for( i=0; i&lt;256;i++ ) {
    array[i] = 0x00;
}
</code></pre>
 4143: <p>There is a single-line command you can use:</p>

<pre><code>memset(array, 0, 256);
</code></pre>
