Hi All,
I am a newbee to PalmOS. I have a Problem using Char* in my application.
Please suggest me where I am wrong.
Here is the sample code for the same.
/Public Variable
Char* root;
Char* Attrib;
ReadTag(Char* input)
{
root = ReadAttrib(Char*);
MemPtrFree(Attrib);
Attrib = NULL;
// Store root in List1
}
Char* ReadAttrib(Char*)
{
Attrib = MemPtrNew(sizeof(Char[100]));
// Read Through List2
// Return Attrib;
}
After I get the value in root from ReadAttrib(), in my future functions
I am saying attrib is equal to NULL. Then root Value is also initialising
it self to NULL or some junk value.
Can Any body suggest me whether it is better to use MemPtr or MemHandle
for working around with Char*. How is it possible to free all the variables
declared in a function. Is there any call that does it. If not how can
I free memory for variable root that I initialised in ReadTag. And how
important is it to allocate memory to a Char* before using it, even though
it is just for assignment.
I nees this information very urgently.
Thanks in Advance.
Regards,
Sridhar Lanka
__________________________________________________
FREE voicemail, email, and fax...all in one place.
Sign Up Now! http://www.onebox.com
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/