Witam napisałem takie coś
struct map{
int x;
int y;
};
struct map* duplicate(struct map *mapa1)
{
struct map* newxmap;
newxmap = (struct map*) malloc(sizeof(struct map));
newxmap->x = mapa1->x;
newxmap->y = mapa1->y;
return newxmap;
}
int main()
{
struct map my;
my.x = 10;
my.y = 10;
duplicate(&my);
return 0;
}
I teoretycznie to działa bo nie wywala błędu ale praktycznie jak wywołać to tzn. jak odwołać się do skopiowanej struktury... jak napisać na ekranie newxmap.x np...