scusate, non ho indicato con * per non confondere con puntatori ma e' in

temp=*c1.g[k];
*c1.g[k]=*c2.g[k];
*c2.g[k]=temp;