void funcF(char *outBuffer)
{
char * inBuffer;
inBuffer = (char *) malloc(500);
// add stuff to inBuffer
strcpy(inBuffer, "blabla");
outBuffer = inBuffer; //probably this is wrong
}
int main()
{
char * outBuffer;
funcF(outBuffer);
printf("%s", outBuffer); // i want to get "blabla" as output
free(outBuffer);
}
私の質問では、データにアクセスできるようoutBuffer
に、同じアドレスをどのように指定できますか?inBuffer
inBuffer