If I set an array variable a[]="abc" , and then set another array variable b[]={'d','e','f'} ,my last output code is printf("%s",b) ,it's output value is "defabc",why? My output is array b but the output value will output array b first and then output array a second. The whole code is on bellow.
#include<stdio.h>
void main(){
char a[]="abc";
char b[]={'d','e','f'};
printf("%s",b);
}
The output is "defabc". And the string length of array b is 7 why?
char b[]={'d','e','f', '\0'};