Skip to content

Latest commit

 

History

History
51 lines (47 loc) · 1.2 KB

File metadata and controls

51 lines (47 loc) · 1.2 KB
title Arrays in Expressions | Microsoft Docs
ms.custom
ms.date 11/04/2016
ms.reviewer
ms.suite
ms.technology
cpp-language
ms.tgt_pltfrm
ms.topic language-reference
dev_langs
C++
helpviewer_keywords
expressions [C++], arrays in
arrays [C++], in expressions
ms.assetid 6e5a795b-d6bd-4e39-b313-6a20d47c4d4b
caps.latest.revision 7
author mikeblome
ms.author mblome
manager ghogen
translation.priority.ht
cs-cz
de-de
es-es
fr-fr
it-it
ja-jp
ko-kr
pl-pl
pt-br
ru-ru
tr-tr
zh-cn
zh-tw

Arrays in Expressions

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;  

See Also

Arrays