I'm getting a bus error while running my program, and I pretty sure it's located in this particular function. If anybody can spot what's wrong with it, it would help me out a lot. thanks in advance. (I've left out a lot of the code so you don't have to read through it all)
Code:
#include <stdio.h>
#define NUMPRODUCTS 11
#define STRINGLEN 50
int main(void)
{
/*break from code*/
/* step 5: thank user. */
thankUser(productNames, choice,
dollarsBack, quartersBack, dimesBack, nickelsBack, penniesBack);
}
void thankUser(char productNames[][STRINGLEN], int choice,
int dollarsBack, int quartersBack, int dimesBack, int nickelsBack, int penniesBack) {
printf("Thank you for selecting a %s", productNames
[choice][STRINGLEN]); printf("Your change is:\n");
printf("%d dollars\n", dollarsBack);
printf("%d quarters\n", quartersBack);
printf("%d dimes\n", dimesBack);
printf("%d nickels\n", nickelsBack);
printf("%d pennies\n", penniesBack);
printf("Enjoy your %s!\n",
productNames [choice][STRINGLEN]);