I defined the following structure:
typedef struct {
double salary;
} Employee;
I want to change the value salary. I am trying to pass it by reference, but the value remains unchanged. Below is the code:
void raiseSalary (Employee* e, double newSalary) {
Employee myEmployee = *e;
myEmployee.salary = newSalary;
}
When I call this function, it salaryremains unchanged. What am I doing wrong?
source
share