Page 1 of 1

Parallel routines - Bestway to convert strings to char*

Posted: Mon Aug 24, 2015 8:49 am
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.

Posted: Tue Aug 25, 2015 6:37 am
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.

Posted: Tue Aug 25, 2015 4:54 pm
by ray.wurlod
And if you're allocating memory to local variables, simply free those in the usual fashion before returning.