Article View: comp.std.c++
Article #4000Re: Array function params and const qualifier
From: Steve Clamage
Date: Fri, 12 Apr 1996 00:27
Date: Fri, 12 Apr 1996 00:27
25 lines
1821 bytes
1821 bytes
In article rp3@mozart.wg.icl.co.uk, Adel El-Beik <A.El-Beik@man0506.wins.icl.co.uk> writes:
>I have a question concerning MSVC++ v.4.00 and the April DWP C++.
>
>The following code fails on MSVC++. It doesn't like line labelled 1.
>It complains with
>
>C:\array\array.cpp(16) : error C2664: 'func' : cannot convert parameter 1
>from 'long [2][2]' to 'const long [][2]' (new behavior; please see help)
You have run into effectively the same rule that prohibits implicit
conversion from "T**" to "const T**". That prohibition is not new,
but is in the ISO/ANSI C standard, and has not been changed, since
it would open a hole in the type system.
I believe the subject is covered in the comp.lang.c FAQ list.
---
Steve Clamage, stephen.clamage@eng.sun.com
---
[ comp.std.c++ is moderated. To submit articles: Try just posting with your
newsreader. If that fails, use mailto:std-c++@ncar.ucar.edu
comp.std.c++ FAQ: http://reality.sgi.com/austern/std-c++/faq.html
Moderation policy: http://reality.sgi.com/austern/std-c++/policy.html
Comments? mailto:std-c++-request@ncar.ucar.edu
]
Technical Details
Message-ID:
<4kjqqa$bol@engnews1.Eng.Sun.COM>Path:
arc1-ca.pugleaf.net!fido.asd.sgi.com!austernReferences:
<4ke06a$rp3@mozart.wg.icl.co.uk>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!fido.asd.sgi.com!austern From: clamage@Eng.Sun.COM (Steve Clamage) Newsgroups: comp.std.c++ Subject: Re: Array function params and const qualifier Date: 11 Apr 1996 17:27:59 PDT Organization: Sun Microsystems Inc. Approved: austern@isolde.mti.sgi.com Message-ID: <4kjqqa$bol@engnews1.Eng.Sun.COM> References: <4ke06a$rp3@mozart.wg.icl.co.uk> Reply-To: clamage@Eng.Sun.COM NNTP-Posting-Host: isolde.mti.sgi.com X-Original-Date: 11 Apr 1996 20:41:46 GMT X-Auth: PGPMoose V1.1 PGP comp.std.c++ iQBVAwUBMW2jkUy4NqrwXLNJAQGZkgH+LZBCl1vc3gTcv1PmEtv8Z3ME6t9WjZ0C caBRVEPy5pP3k0YV/+mxI4R7ZhGVQKOkdiu8up/FZ0HUOJYQ0tsKUA== =8UDH Originator: austern@isolde.mti.sgi.com