错误:"sort"不是"std"的成员 [英] error: 'sort' is not a member of 'std'

查看:185
本文介绍了错误:"sort"不是"std"的成员的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只想问这个错误是什么意思,以及如何解决呢!

I just would like to ask what does this error mean and how to fix it thanks!

错误:"sort"不是"std"的成员

error: 'sort' is not a member of 'std'

vector<int> result;
        for (auto & i : numbers)
            result.push_back(std::stoi(i));
        std::sort(result.begin(), result.end());

推荐答案

包括算法标头.这就是为什么有错误.

Include the algorithm header. That's why there is a error.

#include <algorithm>

这篇关于错误:"sort"不是"std"的成员的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆