Parallel routines - Bestway to convert strings to char*

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
pavankvk
Participant
Posts: 202
Joined: Thu Dec 04, 2003 7:54 am

Parallel routines - Bestway to convert strings to char*

Post by pavankvk »

Hi

We have some parallel routines that are porting from linux to windows. some of the routines, planning to rewrite in c++ and use string objects. Howerver datastage native is char*

what is the best way to convert string to char* and vice versa? if a malloc is done to copy string to char* and return char* how to free that malloc before returning it.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Are the char* parameters passed as input or input/output to the external routines? If so, then there shouldn't be an issue with garbage collection.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

And if you're allocating memory to local variables, simply free those in the usual fashion before returning.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply