In my current code I have something like this
while(true) //Infinite loop
{
char buff[60];
.....
....
}
I wanted to know what would be better performance wise.
memset(buff, 0, 60);
orNote:
My requirement is that I need to have the char
array totally clean everytime the loop restarts.
"The way it is" doesn't give you an array full of zeros. But you don't have to call memset
anyway. If you are only to use buff
inside of the loop, I think it is better to keep it in the scope of the loop:
while(true) //Infinite loop
{
char buff[60] = {}; // buff is full of zeros
.....
....
}