I would
prefer first case if I am swapping some heavy data, lets say some struct x
, so we pass address of struct
which is a fixed size depends on system.
prefer second case for normal data like int
or char
etc..
There is no need to allocate memory and free.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…