title: Shared memory for sharing an array of the same structure
body: <p>Okay look first thanks for this place :)
  I would like to create a piece of shared memory to store 30 structures of the same type, but I am getting errors on compile..</p>
  
  <pre><code>struct nota
  {
      int n;
      char text[30];
      char titulo[100];
      char login[20];
  }
  
  main(){
       int shmID;
       struct nota *evernota;
       struct nota um;
  
       shmID = shmget(1009, sizeof(struct nota)*30 , 0666 | IPC_CREAT);
  
       evernota = shmat(shmID, NULL, 0);
  
       evernota[0] = &amp;um;  //Declaring one note here to the first position of shm..
       evernota[20] = &amp;um;  //Declaring the same note on the 20 position of shm..
  
       printf("o meu int é %d\n",evernota[0]-&gt;n);  //Here I would get the int n of each structure, that should be 0, because its not initialized..
       printf("o meu int é %d\n",evernota[20]-&gt;n);  //and there the same n, because I use the same structure on position 0 and 20..  
  }
  </code></pre>
  
  <p>But I have compile errors, someone see where is the problem??
  Thanks alot in advance!!!</p>