How to compare two vectors in C ++

This is my code:

#include <algorithm> void f() { int[] a = {1, 2, 3, 4}; int[] b = {1, 2, 100, 101}; // I want to do something like this: // int* found = compare(a[0], a[3], b[0]); // in order to get a pointer to a[2] } 

Perhaps I skipped this algorithm in the manual ... Please help :)

+4
source share
2 answers

Sort your array and use mismatch .

+5
source
+6
source

Source: https://habr.com/ru/post/1310833/


All Articles