Is it possible to initialize an integer array inline when calling a method in c++ (avr-g++)?
This is what I tried:
A({2, 4, 8, 3, 6});
void A(int* b) {
}
And I got this error:
cannot convert '' to 'int*' for argument '1' to 'void A(int*)' cannot convert '' to 'int*' for argument '1' to 'void A(int*)'
Looking at my old question I figured out I actually know the answer to this now. Here goes:
void A(int *b) {
}
void foo() {
A((int[]){1,2,3});
}