How do I get the pointer to the first item in a vector for qsort's first argument? : <p>I know that to get the pointer to the first element of a vector, you can do:</p>

<pre><code>&amp;myvector[0];
//or
&amp;myvector.front();
</code></pre>

<p>I want to use the pointer above to insert it as the first argument for <a href="http://www.cplusplus.com/reference/cstdlib/qsort/" rel="nofollow noreferrer"><code>qsort</code></a>. The problem is, when I do this:</p>

<pre><code>qsort(graph-&gt;&amp;edge[0], ..., ..., myComparatorFunction);
</code></pre>

<p>I get this error <code>expected unqualified-id before '&amp;' token</code>. The <code>graph</code> refers to an instance of a self-made class below:</p>

<pre><code>class Graph {
public:
    int V, E;
    vector&lt;Edge&gt; edge;
};
</code></pre>

<p>The instance is created using:</p>

<pre><code>Graph* createGraph(vector&lt;Edge&gt; edge) {
    Graph* graph = new Graph;
    graph-&gt;edge = edge;
    return graph;
}
</code></pre>

<p>How do I get rid of the error while achieving what I want?</p>
