"cannot convert to a pointer type" with accessing struct via pointer
<pre><code>gcc -g -O2    struct.c   -o struct
struct.c: In function ‘secondfunction’:
struct.c:19:2: error: cannot convert to a pointer type
  firstfunction((void *)onedata-&gt;c,(void *)&amp;twodata.c,2);
  ^~~~~~~~~~~~~
&lt;builtin&gt;: recipe for target 'struct' failed
make: *** [struct] Error 1
</code></pre>

<p>I'm trying to use pointer when copying contents of of struct to another struct via memcpy. But when I transfer pointer to the struct into function I cannot cast it into the void. </p>

<pre><code>struct one {
    char a;
    char b;
};

struct two {
    struct one c;
    struct one d;
};

void firstfunction(void *source, void *dest, int size)
{
    //memcpy(dest,source,size)
}

void secondfunction(struct two *onedata)
{
    struct two twodata;
    firstfunction((void *)onedata-&gt;c,(void *)&amp;twodata.c,2);
}

void main()
{
    struct two onedata;
    secondfunction(&amp;onedata);
}
</code></pre>