Thanks!
 I have also tried initializing the pointers 
Char *p = "text"
But still the error persists.. Run68K.c, Line:2210, Invalid write to
F1C80170.

I do understand this error is related to the pointers but don't know what
exactly has to be done to overcome this error message...


///////////////////////////////////////////////
Invalid write to 0000859C" should tell you that 'p' is pointing to an
improper memory location. What all the other people have been telling you is
that "Char *p;" declares a pointer, but it doesn't point to anything until 
you make it point to something. It's like the following example;

int x, y, z;
x = y + z;

What is the value of 'x'? You don't know, because you didn't set y and z to
anything. Same with your "Char *p;". You have a pointer, but it doesn't
point to anything yet.

If this is not clear, then you must study pointers and addresses. There are
countless tutorials on the internet, and many good reference books.


-----Original Message-----
From: %%email.bounce%% [mailto:%%email.bounce%%] On Behalf Of Ryan Dorn
Sent: Monday, January 07, 2008 8:15 PM
To: Palm Developer Forum
Subject: RE: unable to use StrPrintF()

If you use this code:

Char *p = (Char *)MemPtrNew(32);
StrPrintF(p, "%d", num);
MemPtrFree(p);

Does it still crash?

Also, if it does crash, are you absolutely sure that
this is where it is happening?

- Ryan

--- Geetha Arasu <[EMAIL PROTECTED]> wrote:

> 
> 
>  Thanks!
> I used both the initializations  with the array and
> the pointer earlier ..
> Char *p or char p[20].. still I am getting the same
> error. Its very strange 
> 
> Is there any alternate function to print the value
> to a string?
> 
> 
> -----Original Message-----
> From: %%email.bounce%% [mailto:%%email.bounce%%] On
> Behalf Of Hynek Sladky
> Sent: Monday, January 07, 2008 5:53 PM
> To: Palm Developer Forum
> Subject: Re: unable to use StrPrintF()
> 
> 1. p is not initialized in Your example!
>     p=MemPtrNew (32);
>   or
>     Char p[32];
> 2. num is UInt16 or Int16? In case of 32-bit value
> use %ld...
> 
> Hynek Sladky
> 
> 
> Geetha Arasu wrote:
> > 
> >  I am not able to use StrPrintF()
> > Char *p;
> > StrPrintF(p,"%d" , num);
> > 
> > Where num is short data type.
> >  
> >   When I use this func, there are no compile
> errors but shows the run time
> > error message " Invalid write to 008F3301"
> > 
> > Could any one suggest is there any error in the
> above function or is there
> > any alternate method to print the value to a
> string.
> 
> -- 
> For information on using the ACCESS Developer
> Forums, or to unsubscribe,
> please see
> http://www.access-company.com/developers/forums/
> 
> 
> 
> -- 
> For information on using the ACCESS Developer
> Forums, or to unsubscribe, please see
> http://www.access-company.com/developers/forums/
> 



 
____________________________________________________________________________
________
Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ 


-- 
For information on using the ACCESS Developer Forums, or to unsubscribe,
please see http://www.access-company.com/developers/forums/



-- 
For information on using the ACCESS Developer Forums, or to unsubscribe, please 
see http://www.access-company.com/developers/forums/

Reply via email to