Take the 2-minute tour ×

I have read char four[4] = "four"; What are the correct semantics for this statement?

I am using Xcode and writing Objective C code. I don't understand why:

char words[4] = { "aardvark", "abacus", "allude", "zygote" };

gives a warning

warning: Semantic Issue: Initializer-string for char array is too long



works fine. Kindly guide me.

share|improve this question

1 Answer 1

I was not aware of the differences between an integer pointer and a character pointer. Hence, I was confused. This helped me: http://www.computing.net/answers/programming/why-this-works-char-pointer-in-c/4444.html

share|improve this answer

Your Answer


