I need help creating an array that will take the size of a an input value so far I've tried this
But all it does is take one input value and then just gets stuck in a loopCode:void custom (int amount)
{
int *custh, *custl, *delarray;
int i;
unsigned char pthold = inp(0x43), logical, sndhold = (0x61);
custh = (int *) malloc( amount*sizeof( int ) );
custl = (int *) malloc(amount*sizeof( int ) );
delarray = (int *) malloc(amount*sizeof( int ) );
printf("Please enter the high, low values for the notes and the delay:\n");
for(i = 0; i < amount; i++)
{
printf("High value #%d: ", i + 1);
scanf("%d", &custh[i]);
printf("Low value #%d: ", i + 1);
scanf("%d", &custl[i]);
printf("Delay of #%dst value: ", i + 1);
scanf("%d", &delarray[i]);
}
outp(0x43, pthold | 0xB6);
for(i = 0; i < amount; i++)
{
timer(custh[i], custl[i]);
speaker(sndhold, delarray[i]);
}
}