I wonder if it is possible for one function, such as swap (), to be used in two different structures to replace them? For example,
typedef struct{ char a; }one; typedef struct{ int c; }two; swap(??,??){
So, based on this, is it possible for the swap function to change elements in the structures? For example, you can use: 1. swap (arr [1], arr [2]); 2. swap (brr [1], brr [2]);
From my point of view, such a thing cannot be done, since the data type for the struct (and also its element) is different. I was interested in creating a modular function for one of my projects, so the help would be really appreciated.
Thanks.
source share