C without main()!!!

Discussion in 'C' started by Tango Issac Debian, Jul 8, 2006.

  1. Tango Issac Debian

    Tango Issac Debian New Member

    Joined:
    May 3, 2006
    Messages:
    31
    Likes Received:
    1
    Trophy Points:
    0
    Some days ago, I have started to think about " Is it possible to construct a C programmre without a main() func?"

    Then think ing about it during somedays i have find out its solutions as
    Code:
    #include <stdio.h>
    #define decode(t,h,n,k,y,o,u) m##s##u##t
    #define begin decode(a,n,i,m,a,t,e)
    begin()
    {
    	printf("Hallo everyone,It is the Programme without main() function!!!");
    	return 0;
    }
     
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    I could not compile that in VC 6. It gave an error regarding unresolved external symbol _main.
     
  3. Aztec

    Aztec New Member

    Joined:
    May 9, 2006
    Messages:
    90
    Likes Received:
    0
    Trophy Points:
    0
    @Tango

    Your code still has main. Anyways, if you still want to use macro then why not do simply this
    Code:
    #define begin main
    @Shabbir

    VC6 sucks. Use a better compiler.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice