C++ Codes
Algorithms
Algorithm Analysis in C++
Beginners
Code Snippets
Graphics
Data Structures
File Manipulation
Games
Mathematics
Miscellaneous
Visual C++ Library
C++ > Visual C++ 5.0 Standard C++ Library sample source codes
Vector operatorgteq - Returns true if !(v1 < v2).
Vector operatorgteq - Returns true if !(v1 < v2). operator>= Header <vector> template<class T, class A> bool operator>=(const vector<T, A>&v1, const vector<T, A>&v2) ; Returns true if !(v1 < v2). Sample #include <vector> #include <iostream> int main() { std::vector<int> c1, c2, c3, c4 ; int i ; for (i = 0; i < 10; i++) { c1.push_back(i) ; c2.push_back(i*i) ; c3.push_back(i*i*i) ; c4.push_back(i) ; } if (c1 == c4) std::cout << "c1 == c4" << std::endl ; if (c2 != c3) std::cout << "c2 != c3" << std::endl ; if(c2 < c3) std::cout << "c2 < c3" << std::endl ; if(c3 > c2) std::cout << "c3 > c2" << std::endl ; c4.push_back(29) ; if (c1 <= c4) std::cout << "after c4.push_back(29), c1 <= c4" << std::endl ; if (c3 >= c2) std::cout << "c3 >= c2" << std::endl ; std::swap(c3, c2) ; std::cout << "after swapping c3 with c2, " ; if (c3 >= c2) std::cout << "c3 >= c2" << std::endl ; else std::cout << "c3 < c2" << std::endl ; return 0 ; } Program Output c1 == c4 c2 != c3 c2 < c3 c3 > c2 after c4.push_back(29), c1 <= c4 c3 >= c2 after swapping c3 with c2, c3 < c2
Privacy Policy
|
Link to Us
|
Links