1

can anyone explain "auto subarrys = [&A](int k)" in the following code? Especially, the "[&A]".

vector<int> A = {1, 2, 1};

auto subarrys = [&A](int k) {
    //do something here
};

subarrys(k);

Thanks!

Ting Wang
  • 221
  • 3
  • 13

0 Answers0