no match for 'operator*' in 'shared_data *shm' error
<p>This program is suppose to create a shared memory between a child and parent process where the child process saves into it the fibonacci sequence of a certain length (argument) and the parent process spits it out. it's also suppose to attach and detach the shared memory. Everything seems functional except for the fact that I get this error:</p>

<pre><code>proj2.cpp:40: error: no match for 'operator*' in 'shared_data *shm' error
</code></pre>

<p>Any help? code below.</p>

<pre><code>#include &lt;unistd.h&gt;
#include &lt;sys/types.h&gt;
#include &lt;sys/wait.h&gt;
#include &lt;sys/shm.h&gt;
#include &lt;stdio.h&gt;
#include &lt;stdlib.h&gt;
#include &lt;sys/stat.h&gt;
#include &lt;iostream&gt;

#define MAX_SEQUENCE 10

struct shared_data{
    long fib_sequence[MAX_SEQUENCE];
    int sequence_size;
} shared_data;

using namespace std;

char * shm;

int Fibonacci(int n){
    int first = 0, second = 1, temp = 0;
    shared_data.fib_sequence[0] = first;
    shared_data.fib_sequence[1] = second;
    for(int i = 2; i&lt;=n; i++){
            temp = first + second;
            shared_data.fib_sequence[i] = temp;
            first = second;
            second = temp;
    }
    return 0;
}

int main(int argc, char *argv[])
{
    pid_t pid;
    int seg_id;
    const int shd = 4096;
    seg_id = shmget(IPC_PRIVATE, shd, S_IRUSR | S_IWUSR);
    shared_data *shm = shmat(seg_id, NULL, 0); 
    int number = atoi(argv[1]);    
    if(number &lt; 0 || number &gt; 10){
        cout &lt;&lt; "Invalid number. Please enter a number greater than 0 \n";
        return(1);
    }
    shared_data.sequence_size = number;
    pid = fork();
    if(pid == 0)
        Fibonacci(number);
    else{
        waitpid(pid,0,0);
        for (int i = 0; i &lt;= shared_data.sequence_size; i++)
            cout &lt;&lt; shared_data.fib_sequence[i];
        cout &lt;&lt; "\n";
    }
    return 0;
}
</code></pre>
