Why is my variable not updating when I use a switch statement?
问题 I am a student, and I am trying to make an adventure text game, without using arrays. This code is a function, called by main (within another switch case statement). The problem is, the day doesn't update. It only updates when the code is included inline in main . int getArea (int nArea) //area and day { int nShisha, nBall, nLolipop, nPepsi ; int nUser; //test variables int nPrice; // testing variable for price int naUser ; int nDay; nDay = 2; printf("Choose your Area\n"); printf("1. Riyadh