i seem to be getting expression syntax error when I try

datatype* var = ( datatype ) ptr;


the memory pointer is breing created fine. I just cant seem to use it for
my variable??


also, once I have var, how do I set it with some data?

can I just say:

var = {"some stuff","some more stuff","last stuff"};


if my datatype is



typedef struct{
        char stuff1[20];
        char stuff2[20];
        char stuff3[20];
}datatype;

  

On Mon, 29 Jan 2001, Steve Mann wrote:

> >how do I allocate some memory, clear it out, and then set my variable type
> >to use it???
> 
> There are a few different ways to do this. Here's my preferred method:
> 
> MemPtr ptr = MemPtrNew (sizeof ( datatype));
> MemSet ( ptr, sizeof ( datatype), 0 );
> datatype* var = ( datatype ) ptr;
> 
> Don't forget to free the pointer when you're done with it.
> 


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