I am reading the book Windows System Programming. In the second chapter, there is a program Cat.c , It implements the cat command of linux. The code is http://pastebin.com/wwQFp599
On the 20th line, a function is called
iFirstFile = Options (argc, argv, _T("s"), &dashS, NULL);
Code for Option is http://pastebin.com/QegxxFpn
Now, the parameters for option is
(int argc, LPCTSTR argv [], LPCTSTR OptStr, ...)
1) What is this "..."? Do it mean we can supply it unlimited number of arguments of type LPCTSTR ?
2)If I execute the program as cat -s a.txt
a) What will be the argc and why? b) What will be the argv and why? c) What is _T("s")? Why _T is used here? d) Why &dashS is used? It is address of a boolean most probably. But I can't understand the logic behind use of this. e) Why they have passed NULL as last parameter?
I have Basic knowledge of C programming and these things are really confusing. So kindly explain.