Is main a valid variable name?

posted Apr 26, 2011, 11:11 PM by Oka Kurniawan   [ updated Apr 26, 2011, 11:13 PM ]
Dear Students,
I just want to make some correction for Revision Exercise 1 on Chapter 2. On Question 1 (h), it is asked whether "main" is a valid identifier. In my previous comments, I mentioned it is not. One student just pointed out that it is a valid identifier. I have just tried it in Visual Studio 2008, and she is right. So on Appendix 1, only the reserved words are invalid variable names, but predefined identifiers are valid variable names. Now, main is one of the pre-defined identifiers. Thanks to Min Qin who pointed this out.