Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. main()

main()

Scheduled Pinned Locked Moved C / C++ / MFC
question
5 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Anilkumar K V
    wrote on last edited by
    #1

    what happen if we use inline keyword before main(). is it allowed? if yes how what will be behavior of programm

    T W 2 Replies Last reply
    0
    • A Anilkumar K V

      what happen if we use inline keyword before main(). is it allowed? if yes how what will be behavior of programm

      T Offline
      T Offline
      toxcct
      wrote on last edited by
      #2

      inline doesn't enforce the function to be actually inlined. it's up to the compiler to decide if the function is simple enough. moreover, the main goel in inlining functions is for earning some call time when the function is called multiple times ; main is called once AVAIK !


      Don't know where to start ?
      Refer the Forums Guidelines and ask a friend

      [VisualCalc 3.0][Flags Beginner's Guide]

      D 1 Reply Last reply
      0
      • A Anilkumar K V

        what happen if we use inline keyword before main(). is it allowed? if yes how what will be behavior of programm

        W Offline
        W Offline
        Waldermort
        wrote on last edited by
        #3

        Using the keyword inline before a function does not necasserily mean it will be inline, it is more like a request to the compiler. In the case of main() the request would be declined.

        1 Reply Last reply
        0
        • T toxcct

          inline doesn't enforce the function to be actually inlined. it's up to the compiler to decide if the function is simple enough. moreover, the main goel in inlining functions is for earning some call time when the function is called multiple times ; main is called once AVAIK !


          Don't know where to start ?
          Refer the Forums Guidelines and ask a friend

          [VisualCalc 3.0][Flags Beginner's Guide]

          D Offline
          D Offline
          David Crow
          wrote on last edited by
          #4

          toxcct wrote:

          main is called once AVAIK !

          Unless it is called recursively, which I've seen people do.


          "Approved Workmen Are Not Ashamed" - 2 Timothy 2:15

          "Judge not by the eye but by the heart." - Native American Proverb

          T 1 Reply Last reply
          0
          • D David Crow

            toxcct wrote:

            main is called once AVAIK !

            Unless it is called recursively, which I've seen people do.


            "Approved Workmen Are Not Ashamed" - 2 Timothy 2:15

            "Judge not by the eye but by the heart." - Native American Proverb

            T Offline
            T Offline
            toxcct
            wrote on last edited by
            #5

            OMG, yes ! :doh:


            Don't know where to start ?
            Refer the Forums Guidelines and ask a friend

            [VisualCalc 3.0][Flags Beginner's Guide]

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups