From: <[EMAIL PROTECTED]>
> Anyone can tell me the difference between : CharPtr X and char X[10]?

If you meant "What is the difference between CharPtr X and Char X[10]" (note
caps) then this is just a basic C question.  The difference is that when you
declare Char X[10] you are allocating space for 10 Chars, with X being a
pointer to those chars, but when you declare CharPtr X you are only
allocating space for the pointer X.

For example:

static void MyFunc(CharPtr msg)
{
  CharPtr X;
  Char Y[10];

  StrCopy(X, msg);    // ERROR.  No memory to hold msg contents
  StrCopy(Y, msg);    // OK if msg has less than 10 chars
}


-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palm.com/devzone/mailinglists.html

Reply via email to