Global variable “count” ambiguous

前端 未结 3 1396
执念已碎
执念已碎 2020-12-05 07:19
#include 
using namespace std;

int count = 0, cache[50];

int f(int n)
{  
    if(n == 2) count++;
    if(n == 0 || n==1) return n;
    else if (ca         


        
3条回答
  •  孤街浪徒
    2020-12-05 08:05

    I think I may have figured this out. I have found that removing the using namespace std doesn't help, but when I change the name of the variable to something which is less common, like count can be changed to cnt or some personal versions like knt or isCycle. I don't exactly know what is the reason behind this.

提交回复
热议问题