title: Pass vector as pointer
body: <p>I have a vector of float</p>
  
  <pre><code>vector&lt;float&gt;nFloats;
  </code></pre>
  
  <p>I would like to pass it to the following function:</p>
  
  <pre><code>/* This is a non-stream oriented interface to just change the speed of a sound sample */
  int sonicChangeFloatSpeed(
      float *samples,
      int numSamples,
      float speed,
      float pitch,
      float rate,
      float volume,
      int useChordPitch,
      int sampleRate,
      int numChannels)
  {
      sonicStream stream = sonicCreateStream(sampleRate, numChannels);
  
      sonicSetSpeed(stream, speed);
      sonicSetPitch(stream, pitch);
      sonicSetRate(stream, rate);
      sonicSetVolume(stream, volume);
      sonicSetChordPitch(stream, useChordPitch);
      sonicWriteFloatToStream(stream, samples, numSamples);
      sonicFlushStream(stream);
      numSamples = sonicSamplesAvailable(stream);
      sonicReadFloatFromStream(stream, samples, numSamples);
      sonicDestroyStream(stream);
      return numSamples;
  }
  </code></pre>
  
  <p>Can anybody tell me how to do it correctly?</p>
  
  <p>My attempts</p>
  
  <pre><code> 1) int iRet = sonicChangeFloatSpeed(&amp;nFloats[0], *num, 1, 0.5, 1, 1, 1, 48000, 1);
  
   2) int iRet = sonicChangeFloatSpeed(nFloats[0], *num, 1, 0.5, 1, 1, 1, 48000, 1);
  
   3) int iRet = sonicChangeFloatSpeed(*nFloats, *num, 1, 0.5, 1, 1, 1, 48000, 1);
  </code></pre>
  
  <p>all don't work.</p>
  
  <p>I'm sure such a question has already been asked, but I couldn't find any exact duplicate.</p>
  
  <p>Can anybody help?</p>
  
  <p>Thank you.</p>