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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. How to call method inside another method..

How to call method inside another method..

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialquestionc++
9 Posts 4 Posters 1 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.
  • S Offline
    S Offline
    Shah Satish
    wrote on last edited by
    #1

    Hi !! I have one main method and now i want to call this main method in another method.. for example...

    void NORMAL()
    {

    }

    void MAJOR ()
    {

    Here i want to call void NORMAL() method
    }

    In void MAJOR () method, I want to call void NORMAL ().. how can i call it ?? Both are in same .cpp file..n i have no class. Thanking you.. Shah

    M B H 3 Replies Last reply
    0
    • S Shah Satish

      Hi !! I have one main method and now i want to call this main method in another method.. for example...

      void NORMAL()
      {

      }

      void MAJOR ()
      {

      Here i want to call void NORMAL() method
      }

      In void MAJOR () method, I want to call void NORMAL ().. how can i call it ?? Both are in same .cpp file..n i have no class. Thanking you.. Shah

      M Offline
      M Offline
      Maximilien
      wrote on last edited by
      #2

      what about :

      void MAJOR()
      {
      NORMAL();
      }

      This is rrrreeeaaallllyyyy basic stuff, or I did not understood the question.


      Maximilien Lincourt Your Head A Splode - Strong Bad

      S 1 Reply Last reply
      0
      • S Shah Satish

        Hi !! I have one main method and now i want to call this main method in another method.. for example...

        void NORMAL()
        {

        }

        void MAJOR ()
        {

        Here i want to call void NORMAL() method
        }

        In void MAJOR () method, I want to call void NORMAL ().. how can i call it ?? Both are in same .cpp file..n i have no class. Thanking you.. Shah

        B Offline
        B Offline
        benjymous
        wrote on last edited by
        #3

        void MAJOR ()
        {
        NORMAL();
        }

        Come on, this is really beginner stuff! Aren't you calling your MAJOR() function from somewhere else? Where's it getting called from?

        S 1 Reply Last reply
        0
        • M Maximilien

          what about :

          void MAJOR()
          {
          NORMAL();
          }

          This is rrrreeeaaallllyyyy basic stuff, or I did not understood the question.


          Maximilien Lincourt Your Head A Splode - Strong Bad

          S Offline
          S Offline
          Shah Satish
          wrote on last edited by
          #4

          oppsss..Really really sorry.. i have Problem in my code..

          M 1 Reply Last reply
          0
          • B benjymous

            void MAJOR ()
            {
            NORMAL();
            }

            Come on, this is really beginner stuff! Aren't you calling your MAJOR() function from somewhere else? Where's it getting called from?

            S Offline
            S Offline
            Shah Satish
            wrote on last edited by
            #5

            oppsss..Really sorry..Problem in my code..

            1 Reply Last reply
            0
            • S Shah Satish

              Hi !! I have one main method and now i want to call this main method in another method.. for example...

              void NORMAL()
              {

              }

              void MAJOR ()
              {

              Here i want to call void NORMAL() method
              }

              In void MAJOR () method, I want to call void NORMAL ().. how can i call it ?? Both are in same .cpp file..n i have no class. Thanking you.. Shah

              H Offline
              H Offline
              Hamid Taebi
              wrote on last edited by
              #6

              Is this a specifc question or simple question? ;)


              WhiteSky


              S 1 Reply Last reply
              0
              • H Hamid Taebi

                Is this a specifc question or simple question? ;)


                WhiteSky


                S Offline
                S Offline
                Shah Satish
                wrote on last edited by
                #7

                Heee heee..This is not Specific nor Simple.. but its stupid question..Actually i tried same code but it was not working.. problem was in my code but in method.

                H 1 Reply Last reply
                0
                • S Shah Satish

                  oppsss..Really really sorry.. i have Problem in my code..

                  M Offline
                  M Offline
                  Maximilien
                  wrote on last edited by
                  #8

                  and what might be the problem ?


                  Maximilien Lincourt Your Head A Splode - Strong Bad

                  1 Reply Last reply
                  0
                  • S Shah Satish

                    Heee heee..This is not Specific nor Simple.. but its stupid question..Actually i tried same code but it was not working.. problem was in my code but in method.

                    H Offline
                    H Offline
                    Hamid Taebi
                    wrote on last edited by
                    #9

                    Not problem,one thing is important that you could find your problem Its good;)


                    WhiteSky


                    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