_TCHAR* argv[] is a pointer to the argument that the programme is started with, like:
"myexe.exe thisfile" or "myexe.exe -a -b"
argc contains the number of arguments (argv) that the exe was started with.
'int' _tmain instead of 'void' will most likely refer to the fact that VC++ executables always return an exit code on ending in order to communicate to the OS whether they were correctly ended or aborted etc
As you have seen, your exercises work with this template just as well. It's just a more difficult or exact way of putting it.
Main Topics
Browse All Topics





by: jaime_olivaresPosted on 2008-10-08 at 08:03:33ID: 22669762
void main()
is the default implementation for an ascii/ansi application, it could be also:
int main(int argc, char *argv[])
if you need to read the command-line arguments. The following implementation:
int _tmain(int argc, _TCHAR* argv[])
is the default implementation for Unicode application, but can be used for ascii/ansi too. If you won't use the command-line arguments, just ignore them.