My cpp program is not being asking for input.

后端 未结 2 1641
情深已故
情深已故 2020-12-22 15:38

i have come across this question and could not get why it is not asking for input. output of the code is cin0. please explain it why so.

#include

        
2条回答
  •  悲哀的现实
    2020-12-22 16:10

    Shadowing.

    int cin;
    cin >> cin;

    Both cin in the second line refer to the int, not the class you're used to. You're calculation a>>a (ie. roughly equivalent to a / 2^a), just with a variable called cin.

    Choose another variable name.

提交回复
热议问题