segmentation fault using scanf with integer

Should be:

scanf("%d", &userChoice);

Need the ampersand to read it into the location of userChoice, and not the value of userChoice.

Leave a Comment