Hi Dave,

My understanding of it is yes, ANSI C++ in general is stricter than ANSI C
with regards to this.

Rgds,
JK Lam
Metrowerks Technical Support

----- Original Message -----
From: Dave Lippincott <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, April 23, 1999 2:06 PM
Subject: Re: CodeWarrior errors with C++


> That answers the StrVPrintF question (I did try passing the pointer which
> failed also, but assigning to a VoidPtr first worked)  But what about the
> other error messages that work with the C++ compiler turned off?  I tried
> just about all the compiler options without success.  Is the C++ compiler
> just that much more strict?
>
> -----Original Message-----
> From: Jason Dawes <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
> Date: Friday, April 23, 1999 2:13 PM
> Subject: Re: CodeWarrior errors with C++
>
>
> >At 11:20 AM 4/23/99 -0400, you wrote:
> >>I can't seem to find a project setting that will allow me compile my
> project.
> >>
> >
> >This is because you have incorrect code.
> >
> >>Code example:
> >>char MyString[20];
> >>int MyInteger;
> >>
> >>MyInteger = 10;
> >>StrVPrintF(MyString,"%i",MyInteger);        // This line works using C
but
> >>generates typing errors using C++
> >
> >The C compiler is more leniant than the C++ compiler.  The 3rd argument
to
> >StrVPrintF is supposed to be a _pointer_.  You're passing it an int.  C
> >assumes you know what you're talking about and have an address stored in
> >the int.  C++ assumes you don't know what you're talking about unless you
> >say so - either pass the address of MyInteger or cast it to a pointer.
> >
> >The V in StrVPrintF means "vector" - another word for array - another
word
> >for pointer.  If you used StrPrintF instead it would work fine.
> >
> >
> >
>
>
>

Reply via email to