this is a java code, i need to convert it into C.
private void addFrame (int toAdd) {
int[ ] frameScores = new int[0];
totalScore = totalScore + toAdd;
if (frameScores.length < lastFrameNumber) {
int [ ] temp = new int [frameScores.length+1];
for (int k=0; k<frameScores.length; k++) {
temp[k] = frameScores[k];
}
temp[frameScores.length] = totalScore;
frameScores = temp;
}
}
im having problem with
frameScores = temp
it is throwing a incompatible types errors
here is my C code
void addFrame(int toAdd)
{
totalScore = totalScore + toAdd;
if (sizeof(frameScores) < lastFrameNumber) {
int temp[sizeof(frameScores)+1];
for (int k=0; k<sizeof(frameScores); k++)
{
temp[k] = frameScores[k];
}
temp[sizeof(frameScores)] = totalScore;
frameScores = temp;
}
}