今アルゴリズムの勉強してるんですけど、

void alternate( int *a, int *b)
{ //ポインタaとbで指定された内容を交換する
 int w;
 (問1);
 *a = *b;
 (問2);
}

答1、w = *a;
答2、*b = w;
これで交換できますか?