--- Todd Cary wrote:
> var
>   Dst: PChar;
>   Src: PChar;
> begin
>   StrCopy(Src, 'Demo string');
>   // So far so good
>   // Now, how do I copy "string" to Dst?
>   // I need a substring
>   // This does not work: StrCopy(Dst, Src + 5);
> end;

This looks more like a Pascal question than a C
question, since your code is obviously Pascalese.

In C, you could do this:

  Char Src[12];
  Char Dst[7];
  
  StrCopy(Src, "Demo string");
  StrCopy(Dst, Src+5);

Note, however, that the following code would fail in C
because it doesn't allocate any space for the strings:

  Char *Src;
  Char *Dst;
  
  StrCopy(Src, "Demo string");  // error
  StrCopy(Dst, Src+5);  // another error

Your code is probably failing for the same reason.


__________________________________________________
Do You Yahoo!?
Listen to your Yahoo! Mail messages from any phone.
http://phone.yahoo.com

-- 
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