name collision in C++
问题 While writing some code i came across this issue: #include <iostream> class random { public: random(){ std::cout << "yay!! i am called \n" ;} }; random r1 ; int main() { std::cout << "entry!!\n" ; static random r2; std::cout << "done!!\n" ; return 0 ; } When i try to compile this code i get the error error: ârandomâ does not name a type. When I use some different name for the class the code works fine. Seems like random is defined somewhere else(although the compiler message is not very