I want to remove the repetition in this code:
printf( "%.2f: %s\n", 440.00f, "A4" );
printf( "%.2f: %s\n", 523.25f, "C5" );
printf( "%.2f: %s\n", 880.00f, "A5" );
printf( "%.2f: %s\n", 1046.50f, "C6" );
My plan is to make a list of pairs and loop over it. Is it possible and a good solution, or should I just make two arrays?
Just make an array of structs: