Thread: before main

  1. #1
    Registered User
    Join Date
    Jul 2007
    Location
    Hyderabad
    Posts
    35

    before main

    hi,

    iam having a doubt in program execution.

    main itself is executed first or is anything executed first before main.

    could anybody please tell me.

  2. #2
    Deathray Engineer MacGyver's Avatar
    Join Date
    Mar 2007
    Posts
    3,210
    main() is the first thing executed in your program. Whatever happens before main() is native and specific to the system. Mainly it starts your program, initializes whatever needs to be initialized, and then eventually calls main(). You don't need to worry about these details usually.

  3. #3
    Registered User
    Join Date
    Oct 2001
    Posts
    2,129
    main is the first code that you write that is run first. but there may be startup code made by the compiler that gets run before main runs.

  4. #4
    Registered User
    Join Date
    Jul 2007
    Location
    Hyderabad
    Posts
    35
    thank you for reply

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Why To Use int main()
    By year2038bug in forum C Programming
    Replies: 2
    Last Post: 08-19-2005, 01:28 PM
  2. passing params to main()
    By mike11 in forum C++ Programming
    Replies: 14
    Last Post: 06-21-2005, 12:36 PM
  3. pointers
    By InvariantLoop in forum C Programming
    Replies: 13
    Last Post: 02-04-2005, 09:32 AM
  4. Int Main or Void Main?
    By FromHolland in forum C++ Programming
    Replies: 9
    Last Post: 06-12-2003, 04:29 PM
  5. int main (), main (), main (void), int main (void) HELP!!!
    By SmokingMonkey in forum C++ Programming
    Replies: 7
    Last Post: 05-31-2003, 09:46 PM