So i was running some tests and there was strange behavior going on whenever I tried to change a character from a to 0. Instead of changing the element in the array like I expected, the entire array was deleted. Here is what I used to debug
#include <stdio.h>
int main()
{
char test[] = "aa432aa";
for(int i = 0; i<7; i++){
printf("%s\n", test);
if(test[i] == 'a'){
test[i] = 0;
printf("an a\n");
}
else{
printf("not a\n");
}
}
printf("%s", test);
}
And here is the output:
aa432aa
an a
an a
not a
not a
not a
an a
an a