| title | Arrays in Expressions | ||
|---|---|---|---|
| ms.date | 11/04/2016 | ||
| helpviewer_keywords |
|
||
| ms.assetid | 6e5a795b-d6bd-4e39-b313-6a20d47c4d4b |
When an identifier of an array type appears in an expression other than sizeof, address-of (&), or initialization of a reference, it is converted to a pointer to the first array element. For example:
char szError1[] = "Error: Disk drive not ready.";
char *psz = szError1;The pointer psz points to the first element of the array szError1. Note that arrays, unlike pointers, are not modifiable l-values. Therefore, the following assignment is illegal:
szError1 = psz;