strings and arrays

Java gets its notation of array from C, as well as the notion of a string. But the implementations and philosophies and programming standards are very different. A Java programmer will find this particularly painful.

In Java, String is a built-in class, and arrays are a special kind of Object.

C strings and arrays are just pointers.

notation

Both languages use the square bracket “[]” notation for arrays.

There is no string concatenation operator in C, only library functions that handle data that can be interpreted as a string.

C strings

C string literals

C arrays and pointer arithmetic

C multi-dimensional arrays

dangers