Unable to define a global variable in C++

后端 未结 2 1806
南方客
南方客 2020-12-22 12:14

I\'m new to programming and have been happily working my way through C++ A Beginner\'s Guide (which I\'m thoroughly enjoying!). However, I\'ve come across a bit of

2条回答
  •  伪装坚强ぢ
    2020-12-22 12:48

    I'm guessing this is close to the error you get:

    In function 'int main()':
    Line 13: error: reference to 'count' is ambiguous
    compilation terminated due to -Wfatal-errors.
    

    Using the namespace std makes count refer to std::count which is an algorithm in the standard library.

    http://www.cplusplus.com/reference/algorithm/count/

提交回复
热议问题