www.thecareerplus.com
The CareerPlus
Home Technical Resources Programming Declarations and Initializations
Thursday 09th September 2010
 
 
Is char a[3] = "abc"; legal?

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!