HI 
you should also allocate a memory for second[0].
try doing this
MemHandle memH;
Char **   second1 = NULL;
UInt16    i;

memH = MemHandleNew (sizeof (Char *) * 15);
second1 = (Char **) MemHandleLock (memH);
if (!second) 
   { Give Some Error}
for (i=0; i<15; i++)
{
  MemHandle secH;
  secH = MemHandleNew (sizeof (Char *));
  second1[i] = (Char *) MemHandleLock (secH);
  if (!second1[i])
  { error message}
  // do whatever you u want to do with second[0] 
  StrCopy (second1[i], CurrentNode->Product);
}

//And Do not forget to free memory.
//Sample code for  freeing the memory 

void freeMem ()
{
  UInt16 i;
  if (second1)
  {
    for (i=0; i<15; i++)
    {
      if (second1[i])
          MemPtrFree (second1[i]);
    }
   MemPtrFree (second1);
   }
}

--- Sean Charles <[EMAIL PROTECTED]> wrote:
> 
> On Saturday, February 8, 2003, at 01:49 PM, burhan
> ahmad wrote:
> 
> > can anybody plz tell me why cant i copy to
> second1[0];
> > char **second1;//intitialized as below
> > second1 = (Char **) MemPtrNew(15 * sizeof(Char
> *));
> >
> >
> > StrCopy(second1[0], CurrentNode->product);
> ...get the fire hose ready bubba...
> 
> > it gives null string passed error although there
> is char value in 
> > product.
> yeah, what about the destination then.....?
> 
> After allocating space for your pointers, maybe try
> allocatin some space 
> for them to point to. Life may run a little smoother
> after that!
> 
> Sean Charles.
> 
> 
> -- 
> For information on using the Palm Developer Forums,
> or to unsubscribe, please see
http://www.palmos.com/dev/support/forums/


__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to