sprintf_s is a microsoft extension. Use strcopy since your not actually doing a printf.