writing part of an array to file in C++
<p>I want to write k elements starting from k*i to a file. so in a for loop I write as below: </p>

<pre><code>    testOut.write((char*) h_test[k*i] ,k*sizeof(float));
</code></pre>

<p>I get this error "invalid cast from type ‘float’ to type ‘char*’ "</p>

<p>How should I correct this?</p>
