Maybe this has been answered before but my searches didn't find anything (but I'm not sure if I serched for it with the right key words).

So my question is: If you have a method that creates a instance of a struct (like Data d) and then you fill the attributes with info from the user and in the end of the method you do return d can this be a problem?
My point is when you return a structure created as said in method Data create() and then call it like
Code:
Data* pointer = (Data*)malloc(sizeof(Data));
*pointer = create();
will pointer be pointing to wherever d was stored or does it copy d to the place pointed to by pointer?