You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by Xerces Rule <xe...@bilbao.com> on 2002/01/16 09:33:57 UTC

Managing memory

Hi!

I want to read some node's values:

<USER id="914" type="2" />

By using this piece of code:

----------//-----------------------------
Value = My_Node.getNodeValue().transcode();

if (My_Node.getNodeName().equals("id")) { 						
			my_id = (char*)malloc(strlen(Value)+1);
			strcpy(my_id,Value);
-----------//----------------------------

This works fine, but I've noticed that I've wasting a lot of
memory, since I'm using so many 'malloc's.

I would be extremely obliged if anyone could tell me the way
to free memory or manage it correctly.

Best regards.
¿Ya conoces eBay, el mayor centro de compra y venta en internet?
Móviles, portátiles, pda´s, cd´s, cámaras digitales...
¡Compruébalo tú mismo!
http://adfarm.mediaplex.com/ad/ck/1185-5550-4234-3?RedirectEnter&partner=34113&loc=http://www.es.ebay.com

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org