by Dinesh Thakur Category: Array

An array is an array of anything. A string is a specific kind of an array with a well-known convention to determine its length.

 There are two kinds of programming languages: those in which a string is just an array of characters, and those in which it’s a special type. In C, a string is just an array of characters (type char), with one wrinkle: a C string always ends with a NULL character.

 

The “value” of an array is the same as the address of (or a pointer to) the first element; so, frequently, a C string and a pointer to char are used to mean the same thing. An array can be of any length. If it’s passed to a function, there’s no way the function can tell how long the array is supposed to be, unless some convention  is used. The convention for strings is NULL termination; the last character is an ASCII NUL (‘’) character.

 



About Dinesh Thakur

Dinesh ThakurDinesh Thakur holds an B.SC (Computer Science), MCSE, MCDBA, CCNA, CCNP, A+, SCJP certifications. Dinesh authors the hugely popular blog. Where he writes how-to guides around Computer fundamental , computer software, Computer programming, and web apps. For any type of query or something that you think is missing, please feel free to Contact us.



Related Articles