• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: just C++ in xcode
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: just C++ in xcode


  • Subject: Re: just C++ in xcode
  • From: Marshall Clow <email@hidden>
  • Date: Wed, 28 Sep 2005 20:53:48 -0700

Maybe this is a C++ question not having to do with
xcode,  but I'm desparate...

If I have a named namespace in foo1.h:
    namespace myspace
        {
        int myvar;
        };

and in foo1.cpp:
    #include foo1.h
    using namespace myspace;
    myvar=1;

and in foo2.cpp
    #include foo1.h
    using namespace myspace;
    cout<<myvar;


If the code in foo1.cpp executes before foo2.cpp, why should I not find myvar has a value of 1 in foo2?


You've declared two variables. "extern" is your friend here. -- -- Marshall

Marshall Clow     Idio Software   <mailto:email@hidden>

It is by caffeine alone I set my mind in motion.
It is by the beans of Java that thoughts acquire speed,
the hands acquire shaking, the shaking becomes a warning.
It is by caffeine alone I set my mind in motion.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: just C++ in xcode
      • From: Andreas Grosam <email@hidden>
References: 
 >just C++ in xcode (From: Joe Kurtz <email@hidden>)

  • Prev by Date: just C++ in xcode
  • Next by Date: Re: Using AppleScript to access a Copy File Phase in an Xcode project
  • Previous by thread: just C++ in xcode
  • Next by thread: Re: just C++ in xcode
  • Index(es):
    • Date
    • Thread