is memset more efficient than for loop. so if i have
char x[500]; memset(x,0,sizeof(x));
or
char x[500]; for(int i = 0 ; i &
Agree with above. It depends. But, for sure memset is faster or equal to the for-loop. If you are uncertain of your environment or too lazy to test, take the safe route and go with memset.