The problem is you allocate the array dScores before you set the variable iNumberOfScores. Even though iNumberofScores' value gets changed, the memory allocated for dScores doesn't. A simple...