It may have been because I am still new to VS and definitely new to C, but the only thing that allowed me to build was adding
#pragma warning(disable:4996)
At the top of my file, this suppressed the C4996 error I was getting with sprintf
A bit annoying but perfect for my tiny bit of code and by far the easiest.