Hi Baiss,

The problem is this line :

>         _from[0] = new Byte( size );

which should read :

>         _from[0] = new Byte[ size ];

The original code allocated a single byte and set its value to size,
instead of allocating size bytes which is what you want.

Nothing to do with arrays vs. pointers at all :/

-- 
Tony


"Baiss E. Magnusson" wrote:
> 
> 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/

Reply via email to