I wrote a small snippet of C code. Ignore the strange "sentence" name. My question is, why is it that when I call strlen on this array, it prints 5, instead of 2? Thanks.
Code:int main(){ char sentence [2]; sentence[0]= 'y'; sentence[1]='o'; int len= strlen(sentence); printf("%d", len); }



LinkBack URL
About LinkBacks


