Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

c++调试时,使用sort函数报错 #36

Open
kirsuna opened this issue Nov 19, 2023 · 1 comment
Open

c++调试时,使用sort函数报错 #36

kirsuna opened this issue Nov 19, 2023 · 1 comment

Comments

@kirsuna
Copy link

kirsuna commented Nov 19, 2023

c++调试时,使用sort函数对vector容器排序就会报错,注释掉就没问题

报错内容为:
c:\Users\pcc_\AppData\Roaming\Code\User\globalStorage\wangtao0101.debug-leetcode\sourcecppproblem15.cpp:20:5: error: 'sort' was not declared in this scope
sort(nums.begin(), nums.end());
^~~~

@kirsuna
Copy link
Author

kirsuna commented Nov 20, 2023

原因是没有加 #include<algorithm>头文件,问题已解决

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant