无法将[]的索引应用于'EnumerableRowCollection <datarow>类型的表达式

时间:2019-04-27 14:30:21

标签: linq where datarow

我有这段代码:

#include <iostream>

struct Point {
    int x, y;
    Point(int x, int y): x(x), y(y) {};
    Point operator+(const Point& other) const {
        return Point(x + other.x, x + other.y);
    }

};

std::ostream& operator<<(std::ostream& os, const Point& p) {
    return os << "(" << p.x << "," << p.y << ")";
}

int main() {
    Point p = Point(4,7) + Point(8,3);
    std::cout << p << std::endl;
}

我收到上面的错误。我认为应该可以。如何访问结果集的第一条记录?总会有一击,顺便说一句,因此我使用0。

0 个答案:

没有答案
相关问题