Can someone point out the mistake with this code. Its driving me crazy.
#include
using namespace std;
int main() {
int numbers[3] = { 1,2,3 };
auto [x, y, z] = numbers;
}
Can someone point out the mistake with this code. Its driving me crazy.
#include
using namespace std;
int main() {
int numbers[3] = { 1,2,3 };
auto [x, y, z] = numbers;
}
Check your language version. Structured binding is available from C++17.
If it is the right version and assuming you copied your entire code without edit,
#include <iostream>
at the top
and return 0
before closing main()
.