Function arguments are passed by value in C, if you don't use a reference type. When you have:
void f(T t)
{
t = something.....
}
this only affects the local copy t
, not the variable that was given as argument to this function call. Whether or not T
is a pointer type makes no difference
You need to accept the argument by reference if you want to modify it, T &t
here, or in your case Course * &course
.