I have shared library where I does some data generations/processing , and I have written some APIs and application to access them and transfer the data .
/**************APPLICATION*********/
char* data1;
char* data2;
genratedCamData(1, char* data1 , char *data2);
printf(" data1 %s ",data1);
printf(" data2 %s ",data2);
free(data2);
/************Inside Library ****************/
int genratedCamData(1, char* datafirst , char *datasecond)
{
if(CAM==1)
datafirst=getCam1data();
printf(" test at lib %s ",type);
datasecond=malloc(sizeof(char) * 100);
sprintf(datafirst,"%s",datasecond);
return 0;
}
I tried above method get the data to application , but data prints properly inside the library but out side the lib (in the application ) it does not print anything ...
Can some body help me to use a best way to communicate the data b/w libs and application .