CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Guest

    Does anyone know this...

    How does one use the Keyword "using" in the C++ language. How is it declared, and how is it used. Explanation and an example would be great

    Thanks in advance...


  2. #2
    Join Date
    Sep 1999
    Location
    Colorado, USA
    Posts
    1,002

    Re: Does anyone know this...

    Check in namespaces for info. It is a way to distinguish between 2 different variables/functions:
    namespace Jack
    {
    void fetch();
    }
    namespace Jill
    {
    double fetch;
    }
    using Jill::fetch; //tells compiler which one you want or you could write:
    using namespace Jill;
    cin >> fetch;
    //mostly it's used to make definitions visible for an include file:
    #include <iostream>
    using namespace std;
    Older compilers may not recognize the namespace keyword so you'll need to declare:
    #include <iostream.h>
    hope this helps.

    Steve Stofka

  3. #3
    Guest

    Re: Does anyone know this...

    using namespace std; means "please use this list of names so that U can avoid names conflict" as far as I understand.


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