First, we must define the structure tagStudent {...} as global.
Pointer parameters should be used for standard C.
Void foo (structural marker student * output)
It is also unreasonable that the return value is a pointer, because the caller does not know whether this return is to allocate memory or point to a global variable. In one case, a global variable can be considered as a return value declared as const struct tagStudent *
It is reasonable for c++ to use reference parameters.
void foo(struct tag student & amp; Output)
It is not impossible to return the structure, but it may cause a large memory copy. If this structure is large, there will be a big copying process when you receive it with the structure, which is unnecessary in itself. You can pass it in with a pointer parameter and handle it with the same memory address.