Do you know why this prints unsolved externals error?
MSVCRTD.lib(crtexew.obj) : error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup http://paste.ofcode.org/vND8YsnNwVUqYctSjLb95j
Looks like you set the project up as a windows application rather than a console program. It's probably best to start again with a fresh project, then paste the code in.