Exforsys
+ Reply to Thread
Results 1 to 7 of 7

is it possible C program without main() fn

This is a discussion on is it possible C program without main() fn within the C and C++ forums, part of the Programming Talk category; actually tre is no way u can erite a c prog without main .. now its jus abt bluffing .. ...

  1. #1
    harsh gupta is offline Junior Member Array
    Join Date
    May 2009
    Answers
    1

    is it possible C program without main() fn

    actually tre is no way u can erite a c prog without main ..
    now its jus abt bluffing ..

    #include<stdio.h>
    #define decode(s,t,u,m,p,e,d) m##s##u##t
    #define begin decode(a,n,i,m,a,t,e)

    int begin()
    {
    printf(" hello ");
    }

    this prog is encoding main into some other name (here it is "begin ")
    ## is a merging operator..


    Is it correct.....


  2. #2
    rajagiri4 is offline Junior Member Array
    Join Date
    Jul 2009
    Answers
    1
    i think is not possible


  3. #3
    ba7ora's Avatar
    ba7ora is offline Junior Member Array
    Join Date
    Jul 2009
    Location
    Oman
    Answers
    5
    antil now i didnt see a program without main()
    have u tried 2 write a program without main ()????



  4. #4
    shaju1981 is offline Junior Member Array
    Join Date
    Aug 2009
    Answers
    1
    It is possible

    you have to set the entry point as a function name(in this case "Begin") in the linker.


  5. #5
    sitaram murthy is offline Junior Member Array
    Join Date
    Aug 2009
    Answers
    2

    Thumbs up No its not possible to to write a prgm without main()

    hi....... main() indicates the starting of a prgm..... it intimates the control statement to start execution from 'main()' statement......


  6. #6
    sitaram murthy is offline Junior Member Array
    Join Date
    Aug 2009
    Answers
    2

    'c' prg without main()

    hi harsha.can u elobaorate ur explanation


  7. #7
    padmanaban2's Avatar
    padmanaban2 is offline Junior Member Array
    Join Date
    Aug 2009
    Answers
    1
    It is not possible, since only from the main() function we are calling other functions.


    •    Sponsored Ads



Latest Article

Network Security Risk Assessment and Measurement

Read More...