why I can not get the vector data?
<p>I got one problems in my program.
I wrote the code like this </p>

<pre><code>struct Data{
char name[10];
vector&lt;char*&gt; idList;
}
</code></pre>

<p>and I wrote the flowing function </p>

<pre><code>//  Convert Struct to char*
char* getMsg()
{
   char *msg = (char*)malloc(100);
   Data data;
   // Set Value data's name
   strcpy(data.name, "bodandhel");
   // Set Value data's idList
   data.idList.push_back("jams");
   data.idList.push_back("bobss");
   // Use memcpy function
   memcpy(msg, &amp;data, sizeof(Data));
   XXXXXXXXXXXXXXXXXXXXXX
   return msg;
}
</code></pre>

<p>and then I wrote the flowing function  to get the struct from char*</p>

<pre><code>// get the struct from char*
Data getStruct(char *msg)
{ 
   **Data *data;
   data =(Data*)msg;
   return *data;**
}
</code></pre>

<p>if I write the sentence used in  getStruct() in getMsg() XXXXX line , and I can get the right Data Struct.
but If I call function getStruct() and msg is got from getMsg function, badly, I can get the <strong>data</strong> name, <strong>can not got data in vector</strong>, the compiler tell me Wrong Pointer!</p>

<p>I guess there are some data is realsed after call function Msg(), but I don't know why? and how I fix the problem?</p>

<p>my compiler is MSVC 9.0</p>
