FIX: C2664 When Array Is Passed as a Parameter to a Function (143083)
The information in this article applies to:
- Microsoft Visual C++, 32-bit Professional Edition 4.0
- Microsoft Visual C++, 32-bit Professional Edition 4.1
- Microsoft Visual C++, 32-bit Professional Edition 4.2
- Microsoft Visual C++, 32-bit Enterprise Edition 4.2
- Microsoft Visual C++, 32-bit Learning Edition 4.0
- Microsoft Visual C++, 32-bit Learning Edition 4.2
This article was previously published under Q143083 SYMPTOMS
The compiler will generate the following error when you pass a multiple
subscript array to a function that expects a const of the same type of
array:
error C2664: 'Func2' : cannot convert parameter 1 from 'int [4][4]' to
'const int [][4]' (new behavior; please see help)
RESOLUTION
Don't declare the parameter to be 'const' in the function definition.
STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed
at the beginning of this article. This bug was corrected in Visual C++
version 5.0.
Modification Type: | Minor | Last Reviewed: | 7/5/2005 |
---|
Keywords: | kbbug kbCompiler kbCPPonly kbfix kbVC500fix KB143083 |
---|
|