Categories:
.NET (961)
C (387)
C++ (185)
CSS (84)
DBA (8)
General (31)
HTML (48)
Java (641)
JavaScript (220)
JSP (109)
JUnit (31)
MySQL (297)
Networking (10)
Oracle (562)
Perl (48)
Perl (9)
PHP (259)
PL/SQL (140)
RSS (51)
Software QA (28)
SQL Server (5)
Struts (20)
Unix (2)
Windows (3)
XHTML (199)
XML (59)
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, 878👍, 0💬
Popular Posts:
what are the advantages of hosting WCF Services in IIS as compared to self hosting? There are two ma...
How To Escape Special Characters in SQL statements? - MySQL FAQs - Introduction to SQL Basics There ...
Can you explain in brief how can we implement threading ? Private Sub Form1_Load(ByVal sender As Sys...
What are the standard ways of parsing XML document? XML parser sits in between the XML document and ...
Why is there extra white space before or after tables? This is often caused by invalid HTML syntax. ...