title: MPI_Bcast not working - processes still have different values
body: <p>I'm trying to send some data to other processes using <code>MPI_Bcast</code>. I have multiple values that I try to send as string (using <code>sprintf</code> and <code>sscanf</code> to write and read them), but after calling broadcast values won't change. According to answer in <a href="https://stackoverflow.com/questions/7864075/using-mpi-bcast-for-mpi-communication">this question</a> it should work and set same values in all processes. Or am I missing something?</p>
  
  <p>Here's the code:</p>
  
  <pre><code>char send[128];
  int pointSize;
  double *x = new double;
  double *sigma = new double;
  double f_value;
  
  memset(send, 0, sizeof(send));
  sprintf_s(send, "%d %p %p %lf", points.front().getSize(), points.front().getX(), points.front().getSigma(), points.front().getValue());
  printf("[%d]:Before bcast: %s \n", rank, send);
  MPI_Barrier(MPI_COMM_WORLD);
  MPI_Bcast(&amp;send, sizeof(send), MPI_CHAR, rank, MPI_COMM_WORLD);
  sscanf_s(send, "%d %p %p %lf", &amp;pointSize, &amp;x, &amp;sigma, &amp;f_value);
  printf("[%d]:After bcast: %d %p %p %lf \n", rank, pointSize, x, sigma, f_value);
  </code></pre>
  
  <p>And output for 2 processes:</p>
  
  <pre><code>[1]:Before bcast: 10 0000007DAF2D1620 0000007DAF2D0D20 0.000015
  [0]:Before bcast: 10 000000482E545A20 000000482E546560 0.000020
  [0]:After bcast: 10 000000482E545A20 000000482E546560 0.000020
  [1]:After bcast: 10 0000007DAF2D1620 0000007DAF2D0D20 0.000015
  </code></pre>