CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2005
    Location
    Bremen, Germany
    Posts
    33

    Question Basic c++ calling values problem

    Hallo,
    I have a basic c++ problem .

    I have two c++ files, and i want to pass the values between each other.
    for example:
    Mac.cc and scheduler.cc

    In mac.cc , i have a (char buffer) value and I want to use it in scheduler.cc.

    I tried with, by declaring a function in mac.h and pass the buffer variable there but I dont know how to receive it .,

    or is there any other easiest way?.

    Please help me in this regard.

    mfg,
    kings
    kings4u

  2. #2
    Join Date
    Jul 2005
    Location
    Germany
    Posts
    1,194

    Re: Basic c++ calling values problem

    You need to have a global variable in Mac.cc, for example:
    Code:
    int foo = 123;
    And in scheduler.cc you then need to use extern keyword:
    Code:
    extern int foo;
    Please don't forget to rate users who helped you!

  3. #3
    Join Date
    Jul 2005
    Location
    Bremen, Germany
    Posts
    33

    Re: Basic c++ calling values problem

    thank you my friend.
    kings4u

  4. #4
    Join Date
    Jul 2005
    Location
    Germany
    Posts
    1,194

    Re: Basic c++ calling values problem

    Quote Originally Posted by kingslee
    thank you my friend.
    Bitteschön!
    Please don't forget to rate users who helped you!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured