At first i do not know why the b array output result is different for the two code as follows.
No long after,i found that because the b array is out of bounds.The b array is only include five elements.So only has five print result is valid for the b array.
the first code as follows:
#include"stdio.h"
#include"stdlib.h"
int main(void){
char b[5]={"hello world"};
int i;
i=0;
while(i<=15){
printf("%c=%d\n",b[i],b[i]);
i++;
}
return 0;
system("pause");
}
the second code as follows:
#include"stdio.h"
#include"stdlib.h"
int main(void){
char b[5]={"hello world"};
int i=0;
while(i<=15){
printf("%c=%d\n",b[i],b[i]);
i++;
}
return 0;
system("pause");
}