構造体ポインタに問題があります....dsp がポインタではなく、InMemory[Idx] がポインタであることを除いて、本質的に同じことを行っている私のコードの 2 つの例を次に示します。ポインタの場合に memcpy を使用するにはどうすればよいですか?
my_struct* InMemory[SIZE]
//works prints: tmp3:local_file (file name)
memcpy(dsp.result.list[i].owner_name,req.file_name,256);
char tmp3[256];
memcpy(tmp3,dsp.result.list[i].owner_name,256);
printf("tmp3:%s\n",tmp3);
//doesn't work, prints: tmp:_____<---nothing! ??
//I am trying to copy the result from above into a field of the struct pointer array
char tmp2[256];
memcpy(InMemory[Idx]->filename,dsp.result.list[i].owner_name,256);
memcpy(tmp2,InMemory[Idx]->filename,256);
printf("tmp:%s\n",tmp2);