I have a problem. I need to create a code where I can access bool array information from another function, edit the array and then send it back. I need to use a variable as the size of the array.
Global variable is not an option.
I've tried to pass it by a reference and also using structs.
code for example:
void x(bool (&reserved[sizeOfArray)) {
if (reserved[1] == true) {
cout << "it's true";
}
main() {
int sizeOfArray = 6;
bool reserved[sizeOfArray];
x(reserved[sizeOfArray];
edit: the size of the array is determined when the program is already running
std::vector, variable length arrays are not supported in C++reserved[sizeOfArray]would be abool, if it existed.