相关代码 |
|
// Filename: STL-function.cc // Using the function object minus #include #include using namespace std; int main() { double v1[3] = {1.0, 2.5, 4.6}, sum; sum = accumulate(v1, v1 + 3, 0.0, minus()); cout } /*out OOP> g++ stl_function.cc // warnings about feeding double to minus OOP> a.out sum = -7 OOP> */
相关资源 |
|