I have a 50 element array that I periodically need to reinitialize back to zero.
The code fragment follows:
char asciibuf;// Declared Global
loopcountval = strlen(asciibuf);// Figure out # of times to loop
for (i = 1;i<=loopcountval;i++)
asciibuf[i] = 0;// Clear out ASCII buffer
I just use the array as a scratch pad for concantenating strings so when I need a new string I need to clear it out first or end up with an undesired string.
The problem I'm having is when simulating in Studio loopcountval is always a zero, which is confusing to me.
strlen is a Codevision function that requires a char *str as an input.
I tried strlen(&asciibuf) - this generated an error
I tried strlen(&asciibuf) - this returned a 0
Any thoughts on what I am doing wrong?