C: Why is counter not resetting to 0 in for loop [closed]

Try this change:

for (int iHist = 0; iHist < 5; iHist++) {  // <= changed to <
    int frequencyCount = 0;                // Moved this line to be inside the loop

Leave a Comment