Hello programmers, I am new to c++ and I'm currently taking a programming class at school.
I have this problem where I'm using multiple indented switch to calculate the values of two variables based on previously assigned variables, and at the end I get the error code that the two variables haven't been initialized yet. I know for sure that anything else before that part of my code work perfectly, it's been tested several times.
At the end, the variables NbImpR and NbImpRV turn out to be empty of any value, but I know for sure that the other variables NbOri, NbExe, FormatPapier and TypeImpression (the variables on which my equations to calculate NbImpR and NbImpRV are based on) do have values in them.
Can anybody spot where I might have gone wrong ? I am completely clueless as of now.
I am currently unable to access a computer, but I just thought of something.
The values of the variables FormatPapier and TypeImpression in my code are user inputs (previous option menus). To get those values I used _getche() (to echo the selection).
Since _getche() is used to put a character chain (if I remember correctly, correct me if I'm wrong) into a variable, should I write " case '1' " instead of "case 1"? Would that solve my problem, because it seems my program just skips over every switch for some reason?