c++ 如何获得一个指向两个数组中没有共同点的元素的指针?

c0vxltue  于 2024-01-09  发布在  其他
关注(0)|答案(2)|浏览(200)

下面是我的代码:

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

字符串
也许我在手册上漏掉了这个算法。

相关问题