Hi,
think this is a stpuid question but how do reset an arry. I've declared an array
char buffer[10000]={0};
and through out my program I add to it using strcat. Now at some point I want to empty the array and start again by using strcat to add contents to it. I've tried
temp_buffer[]={0}; and also
temp_buffer={0};
I don't want to use a for loop and reset each character since the array is so big, for loop might use up resources? Thanks
Shav
Actually, a for() loop will be faster than you think.
It's only a couple of machine instructions long. And how do you think memset works? :)
register idx;
for (idx = 0; idx < 10000; idx++)
buffer[idx] = 0;
Some machines do have a memory initialization instruction, but I don't think that Intel is one of them.
Good Luck!
Kent