I didn't realize that character arrays had an indeterminate array size when initialized with individual characters.
I ran into problems using strlen as part of a for-loop condition:
1 2 3 4
for (i = 0; i < strlen(CharArrayVar); i++){
printf("%c", CharArrayVar[i]);
}
I assumed that the character array had been null-terminated, but according to the above article, only character arrays initialized with double-quoted strings are.
Thus, the solution is to manually add the null-terminator: