_stscanf_s(test, _T("%2d%s"), &var, tmp, 127);

参考: http://msdn.microsoft.com/ja-jp/library/6ttkkkhh(v=vs.80).aspx