Categories:
.NET (357)
C (330)
C++ (183)
CSS (84)
DBA (2)
General (7)
HTML (4)
Java (574)
JavaScript (106)
JSP (66)
Oracle (114)
Perl (46)
Perl (1)
PHP (1)
PL/SQL (1)
RSS (51)
Software QA (13)
SQL Server (1)
Windows (1)
XHTML (173)
Other Resources:
What does it mean?
Is char a[3] = "abc"; legal? What does it mean?
✍: Guest
It is legal in ANSI C (and perhaps in a few pre-ANSI systems), though useful only in rare circumstances. 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 %s format, etc.
Most of the time, you should let the compiler count the initializers when initializing arrays (in the case of the initializer "abc", of course, the computed size will be 4).
2015-12-09, 2199👍, 0💬
Popular Posts:
How To Enter a New Row into a Table Interactively? - Oracle DBA FAQ - Introduction to Oracle SQL Dev...
Write down the equivalent pointer expression for referring the same element a[i][j][k][l]? a[i] == *...
How To Control Vertical Alignment? - XHTML 1.0 Tutorials - Understanding Tables and Table Cells By d...
Can Sub Procedure/Function Be Called Recursively? - Oracle DBA FAQ - Creating Your Own PL/SQL Proced...
How did you implement UML in your project ? PART II Implementation phase / Coding phase (Class diagr...