www.thecareerplus.com
The CareerPlus
Home Technical Resources Programming Arrays and Pointers
Thursday 09th September 2010
 
 
Is char a[3] = "abc"; legal? What does it mean?

Discuss it!          


It declares an array of size three, initialized with the three characters 'a', 'b',
and 'c', without the usual terminating '\0' character. The array is therefore not
a true C string and cannot be used with strcpy, printf %s, etc. But its legal.

Discuss it!          

CrackTheIntervew.NET
Advertisement
 
Top! Top!