Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Hi,
I too am interested in the answer to this one. The sizeof is in fact
correct, but the program encounters some weirdness in the array handling
on the 68K compilers, where treating _from[0] as a Byte pointer simply
doesn't work.
Any C/C++ language experts care to comment?
--
Tony
Brian Pearson wrote:
>
> Your problem is the use of the sizeof function. It returns the size (in
> bytes) of a data type.
> Since kStaticChar is a pointer to a char, sizeof(kStaticChar) will return 4
> (I think). You should be able to see this in the debugger.
>
> I think that you wanted to say this: int size = StrLen( kStaticChar);
>
> Hope that helps,
>
> Brian.
>
> "Baiss E. Magnusson" <[EMAIL PROTECTED]> wrote in message
> news:18748@palm-dev-forum...
> >
> > Hi,
> >
> > I can't seem to move memory as in the following:
> >
> > Byte* _from[1];
> > const static char kStaticChar[] = {"blah blah blah"};
> >
> > int size = sizeof( kStaticChar );
> >
> > _from[0] = new Byte( size );
> >
> > MemMove( _from[0], kStaticChar, size ); // *** fails
> >
> > StrNCopy( (CharPtr)_from[0], kStaticChar, size ); //
> > *** also fails
> >
> >
> > I would think that either <MemMove> or <StrNCopy> would do.
> > --
> > -- Baiss
> >
> >
>
> --
> For information on using the Palm Developer Forums, or to unsubscribe, please see
>http://www.palmos.com/dev/tech/support/forums/
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/