Why am I getting std::bad_alloc when copy initialing a variable to a member variable
Whenever I try to assign a variable to the value of any member variable of this struct from inside only this one function (this doesn’t happen for any others) I am given an std::bad_alloc exception. the struct and function are shown below (Note this is not the full struct)
i want to change the value of the first program with the second program
here is my problem
Why don’t structs decay into pointers?
It is common knowledge that arrays decay into pointers when passed into functions.