Thread: bot_sounds.cpp
View Single Post
Re: bot_sounds.cpp
Old
  (#7)
sPlOrYgOn
<-- He did it.
 
sPlOrYgOn's Avatar
 
Status: Offline
Posts: 1,558
Join Date: Jan 2004
Location: Los Angeles, California, USA, North America, Earth, Solar System, Milky Way.
Default Re: bot_sounds.cpp - 31-05-2004

hmm
I dunno of any way to teach you what a scope is but to show you...
Code:
#include <iostream>
using namespace std;

namespace blue
{
   int x = 3;
}

int x = 2;

int main ()
{
   int x = 0;
   {
      int x = 1;
      cout << "This is the value of x: " << x << endl;
      cout << "No.. this is.... " << blue::x << endl;
      cout << "Geez idiots this is.. " << ::x << endl;
   }
   cout << "You're all wrong.. this is.. " << x << endl;
   return (0);
}
well thats a little scope thingy...
  
Reply With Quote