how to call a function from another cpp

Discussion in 'C++' started by ahso, Feb 21, 2012.

  1. ahso

    ahso Guest

    Hi
    how to execute a function from another *.cpp? Also how to declare that
    function in both cpp files?
    Many thanks
    Michael
     
    ahso, Feb 21, 2012
    #1
    1. Advertising

  2. ahso

    Ian Collins Guest

    On 02/21/12 10:29 PM, ahso wrote:
    > Hi
    > how to execute a function from another *.cpp? Also how to declare that
    > function in both cpp files?


    Declare it in a header and include the header in both.

    --
    Ian Collins
     
    Ian Collins, Feb 21, 2012
    #2
    1. Advertising

  3. On Feb 21, 9:29 am, ahso <> wrote:
    > Hi
    > how to execute a function from another *.cpp? Also how to declare that
    > function in both cpp files?


    I tried both the C and C++ FAQs (Frequently Asked Questions) and
    couldn't find this one. maybe it's so fundamental it didn't seem worth
    a FAQ. Check out your textbook. K&R definitely describes this quite
    well and I'm sure Stroustrup does too.
     
    Nick Keighley, Feb 21, 2012
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. DrUg13
    Replies:
    1
    Views:
    486
    DrUg13
    Feb 10, 2004
  2. Shawn Campbell
    Replies:
    1
    Views:
    1,202
    Victor Bazarov
    May 21, 2004
  3. Alex Vinokur
    Replies:
    7
    Views:
    416
    Greg Comeau
    Nov 15, 2004
  4. Vinu
    Replies:
    9
    Views:
    643
  5. www.hitechskill.com
    Replies:
    0
    Views:
    1,368
    www.hitechskill.com
    Apr 9, 2006
Loading...

Share This Page