Thread: Check this out !

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Dec 2001
    Posts
    108

    Lightbulb Check this out !

    Some of you probably know how to do this, but i just discovered how to encapsulate the main function. Using Dev C++ 4.9.9.0 i got this bit of code to compile and link with 1 warning issued: resolving _WinMain@16 by linking to _WinMain

    Code:
    #include <iostream>
    
    class main
    {
    public:
        main()
        {
            std::cout << "Hello !";
            exit(0);
        }    
    };
    
    main WinMain;
    It works perfectly, you are just using a WinMain "function" object that does not require 16 bytes of data to be passed to it.
    Last edited by DarkStar; 08-09-2004 at 08:49 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. BN_CLICKED, change button style
    By bennyandthejets in forum Windows Programming
    Replies: 13
    Last Post: 07-05-2010, 11:42 PM
  2. how to check input is decimal or not?
    By kalamram in forum C Programming
    Replies: 3
    Last Post: 08-31-2007, 07:07 PM
  3. Please check this loop
    By Daesom in forum C++ Programming
    Replies: 13
    Last Post: 11-02-2006, 01:52 AM
  4. A way to check for Win98 or WinXP
    By Shadow in forum A Brief History of Cprogramming.com
    Replies: 5
    Last Post: 10-31-2002, 11:06 AM
  5. how to check for end of line in a text file
    By anooj123 in forum C++ Programming
    Replies: 6
    Last Post: 10-24-2002, 11:21 PM