hi im new to C++ and got stuck on some parts of assingment which i seek help :)
say i have structure. The output is 0. Is there a way to change structure variables inside mothod/function? this is simple version of the actual code.
thanks for any help in advance. :)
1 2 3 4 5 6 7 8 9 10 11 12
struct Bag {
double coppers;
} Bag1;
void test (Bag bagNum , double number){
bagNum.coppers = number;
}
int main {
test(Bag1, 5);
cout<<Bag1.coppers<<endl;
}