Say I have the following:
typedef struct {
    int x;
    int y;
    char a;
    char b;
} myStruct;
Is it better practice to create a new myStruct with a function by passing a reference to an empty one, or by returning a myStruct from a function?
void init(myStruct* s){
    //some code
}
int main(){
    myStruct s;
    init(&s);
    return 0;
}
vs
myStruct init(){
    myStruct r;
    //some code
    return r;
}
int main(){
    myStruct s = init();
    return 0;
}
 
     
     
     
     
    