Re: just C++ in xcode
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