I am pretty new to C and I have tried the following code
#include <stdio.h>
int main ()
{
  char str[] = "a";
  for(int x = 0; x < 20; x++)
  {
    printf("%c\t%d\n", str[x],str[x]);
  }
  return 0;
}
For which I get the following output
a   97
    0
    0
s   115
<   60
�   -62
)   41
P   80
�   -42
�   -128
0   48
�   -41
>   62
�   -119
�   -88
U   85
    0
    0
�   -105
�   -85
After str[2] the chars are random for each execution, can someone please explain this behavior.
 
     
    