1 Jun 2002 06:24
Re: Re: Problem with test/cpp_main.cpp
Victor A. Wagner, Jr. <vawjr <at> rudbek.com>
2002-06-01 04:24:52 GMT
2002-06-01 04:24:52 GMT
At Friday 2002/05/31 09:49, you wrote:
>----- Original Message -----
>From: "Victor A. Wagner, Jr." <vawjr <at> rudbek.com>
>
>
> > surely changing the required signature to allow for const is a better
>solution
> > putting const in the signature ALLOWS you to pas both const _and_
>non-const
> > items.
>
>Are you sure? If it was a simple pointer than this would be true, but it's a
>pointer to a pointer. (Or an array of pointers if you prefer.) The following
>does
>not compile in MSVC6 SP5 (and I don't think it should):
>
>void test(const char**) { }
>
>int main(int argc, char** argv)
>{
> test(argv);
> return 0;
>}
>
>error C2664: 'test' : cannot convert parameter 1 from 'char ** ' to 'const
>char ** '
>Conversion loses qualifiers
The following DOES compile on MSVC6 SP5 and MSVC.NET
(Continue reading)
RSS Feed