question about qsort implementation
<p>i have implement this code from programming pearls and i think it should be correct but it gives me this mistake
code:</p>

<pre><code>#include &lt;stdio.h&gt;
#include &lt;iostream&gt;
#include &lt;string.h&gt;
using namespace std;
using std::qsort;
int charcmp(char*x,char *y){   return *x-*y;}
#define wordmax 100
int main(void){
    char word[wordmax];
    char sig[wordmax];
    while(scanf("%s",word)!=EOF){
        strcpy(sig,word);
        qsort(sig,strlen(sig),sizeof(char),charcmp);
        printf("%s %s\n",sig,word);
    }


     return 0;
}
</code></pre>

<p>mistake:</p>

<pre><code>1&gt;------ Build started: Project: anagrams, Configuration: Debug Win32 ------
1&gt;  anagrams.cpp
1&gt;c:\users\david\documents\visual studio 2010\projects\anagrams\anagrams.cpp(11): warning C4996: 'scanf': This function or variable may be unsafe. Consider using scanf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1&gt;          c:\program files\microsoft visual studio 10.0\vc\include\stdio.h(304) : see declaration of 'scanf'
1&gt;c:\users\david\documents\visual studio 2010\projects\anagrams\anagrams.cpp(13): error C2664: 'qsort' : cannot convert parameter 4 from 'int (__cdecl *)(char *,char *)' to 'int (__cdecl *)(const void *,const void *)'
1&gt;          None of the functions with this name in scope match the target type
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
</code></pre>

<p>i think jon bentley  should know such kind of topic yes why is such kind of mistake?</p>
