Mystery for loop

Hi all,

I found this piece of code in my notes and I have no idea why its there or what it does. I was hoping someone can shed some light on it for me.

Thanks

stringone[20]

for (int i = 0; i < 20; i++)
{
stringone[i] = '\0';
}

I am assuming this is the code :
Well, did you mean
char stringone[20]
The loop goes through all the chars in array and replaces them with the null character one by one.
Last edited on
You would assume correctly.

Thanks
Topic archived. No new replies allowed.