I want to change one of attribute in my simple struct. I can't change anything in main function. But the compiler giving me error about scalar type - what does it exactly mean and what do i wrong?
#include <iostream>
using namespace std;
struct Number{
int a;
double b;
};
double zmiana(Number *number,double scale){
number->a*=scale;
return number->a;
}
int main()
{
Number number1={2,3.14};
Number number2=zmiana(&number1,2.);
cout<<&number2;
return 0;
}
Expected output: 4 3.14