#include <stdio.h>
#include<string.h>
int main() {
char a[50],b[50];// same sized arrays
for(int j =0;j<50;j++){
b[j]='b';a[j]='a';// initializing with the same number of elements
}
printf("the size of a is %ld,",strlen(a));
printf("the size of B is %ld",strlen(b));
return 0;
}
The output is
the size of a is 50, the size of B is 54
But what i expect is the size of a is 50 the size of B is 50
what is the problem here?