Yes, this can have an impact on large structures, or large arrays of smaller structures, unless the compiler is able to optimize the call away. It's far more normal to avoid copying data when you already have a copy of it - especially if you aren't intending to modify the copy.
Copying a struct is quite fast - it essentially just blits bytes from one location in memory to another... But copying a pointer is faster. If the struct is small, you might consider copying it so that you avoid extra pointer dereferencing. However, by now you may well be getting into premature optimization.
Back to the pointer approach, normally you help the programmer to realise that the data will not be modified by receiving a const
pointer:
void printShirt( struct shirt const * shirt )
Your example is a bit naive, because the cost of printf
is far greater than copying even a relatively large structure. But I understand what you're trying to ask.