Differences between _tmain () and main () in Visual Studio 2003

Source: Internet
Author: User
People who have used C know that every C program will have a main (), but sometimes it is written by someone else to find that the main function is not an int main (), but an int _tmain (), and the header file is not <iostream.h> but <stdafx.h Will you be confused? Let's see if they have anything to do with it.  First, this _tmain () is to support Unicode used by the main an alias, since it is an alias, there should be a macro defined, where is defined? In that confusing <stdafx.h>, there are two lines of # include <stdio.h> #include <tchar.h> we can find in the header file <tchar.h> _ TMAIN macro Definition     #define _tmain      main So, after pre-compiling, _tmain becomes main, which makes sense.

Differences between _tmain () and main () in Visual Studio 2003

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.