问题已经解决
问题代码段:
for(i = 0; i < n_values; i += 1)
{
printf("? ");
if(scanf("%d", qarray + 1) != 1)
{
printf("Error reading value #%d\n", i );
free(qarray);
exit(EXIT_FAILURE);
}
}
修正后:
for( i = 0; i < n_values; i += 1 ){
printf( "? " );
if( scanf( "%d", qarray + i ) != 1 ){
printf( "Error reading value #%d\n", i );
free(qarray);
exit( EXIT_FAILURE );
}
}
谢谢各位的解答