T
Thierry
Hi,
Here is my source code :
void getData(char *theData)
{
theData = malloc(500);
strcpy(theData,"hello world...");
printf("\n%s\n",theData); // OK
}
void main()
{
char *data;
getData(&data);
printf("\n%s\n",data); // = NULL ???
}
malloc is ok, into the function I get what I want, but data is equal
to NULL in main().
What is the problem ?
thanks for your help.
thierry
Here is my source code :
void getData(char *theData)
{
theData = malloc(500);
strcpy(theData,"hello world...");
printf("\n%s\n",theData); // OK
}
void main()
{
char *data;
getData(&data);
printf("\n%s\n",data); // = NULL ???
}
malloc is ok, into the function I get what I want, but data is equal
to NULL in main().
What is the problem ?
thanks for your help.
thierry