Help on reading the standard!

Discussion in 'C++' started by Bo Yang, Dec 11, 2006.

  1. Bo Yang

    Bo Yang Guest

    Hi,
    I am now reading the C++ standard, and have some troubles.
    What is unqualified name and what is qualified name?

    I found the standard is too hard for non-english programmer!
    Bo Yang, Dec 11, 2006
    #1
    1. Advertising

  2. Bo Yang

    Huck Phin Guest

    A qualified name is what combination and organization of letters,
    numbers, and underscore you can use to declare a variable, function,
    method, or class. To make it a qualified name, 2 things need to be
    true:

    1. In C++, you can use letters, digits, and underscore( _ ) in
    declaring your variable name.
    2. Your variable cannot start with a number.

    3 examples of Qualified Names are:
    myDog
    my_dog
    my_dog3

    3 examples of Unqualified Names are:
    123Dogs
    1Dog1
    $my_dog ( All Special Characters cannot be used except underscore )

    Respectfully Submitted,
    Huck

    P.S. If you are having trouble reading the standard there are many
    books out there for programmers of all different skill levels. You did
    not ask about this, and we ( I am speaking for the collective, or
    rather the groups here ) are always happy to give help whenever you
    would like it, but it may save you a lot of frustration if it is a
    programming expert reading level.
    Huck Phin, Dec 11, 2006
    #2
    1. Advertising

  3. Bo Yang

    Huck Phin Guest

    A qualified name is what combination and organization of letters,
    numbers, and underscore you can use to declare a variable, function,
    method, or class. To make it a qualified name, 2 things need to be
    true:

    1. In C++, you can use letters, digits, and underscore( _ ) in
    declaring your variable name.
    2. Your variable cannot start with a number.

    3 examples of Qualified Names are:
    myDog
    my_dog
    my_dog3

    3 examples of Unqualified Names are:
    123Dogs
    1Dog1
    $my_dog ( All Special Characters cannot be used except underscore )

    Respectfully Submitted,
    Huck
    Huck Phin, Dec 11, 2006
    #3
  4. Bo Yang

    Ian Collins Guest

    Bo Yang wrote:
    > Hi,
    > I am now reading the C++ standard, and have some troubles.
    > What is unqualified name and what is qualified name?
    >

    In C++ names have scope. A fully qualified name is a combination of the
    scope containing the name and the name. An unqualified name is the name
    without the scope.

    Any name declared with in a scope can be used unqualified within the
    containing scope. Any name declared in a scope and used outside of the
    containing scope has to be fully qualified.

    for example:

    namespace fred
    {
    const int x = 1;
    }

    namespace jim
    {
    const int x = 2;
    const int y = x; // unqualified name, uses jim::x
    const int z = fred::x; // use qualified name to access fred::x
    }

    > I found the standard is too hard for non-english programmer!


    You'd be surprised how many English speaking programmers find it hard!
    That's why we have so many text books.

    --
    Ian Collins.
    Ian Collins, Dec 11, 2006
    #4
  5. Bo Yang

    Ian Collins Guest

    Huck Phin wrote:

    Please quote the context of the message you are replying to.

    > A qualified name is what combination and organization of letters,
    > numbers, and underscore you can use to declare a variable, function,
    > method, or class. To make it a qualified name, 2 things need to be
    > true:
    >
    > 1. In C++, you can use letters, digits, and underscore( _ ) in
    > declaring your variable name.
    > 2. Your variable cannot start with a number.
    >

    No. This does not define a qualified name.

    --
    Ian Collins.
    Ian Collins, Dec 11, 2006
    #5
  6. Bo Yang

    Bo Yang Guest

    Ian Collins :
    > Bo Yang wrote:
    >> Hi,
    >> I am now reading the C++ standard, and have some troubles.
    >> What is unqualified name and what is qualified name?
    >>

    > In C++ names have scope. A fully qualified name is a combination of the
    > scope containing the name and the name. An unqualified name is the name
    > without the scope.
    >
    > Any name declared with in a scope can be used unqualified within the
    > containing scope. Any name declared in a scope and used outside of the
    > containing scope has to be fully qualified.
    >
    > for example:
    >
    > namespace fred
    > {
    > const int x = 1;
    > }
    >
    > namespace jim
    > {
    > const int x = 2;
    > const int y = x; // unqualified name, uses jim::x
    > const int z = fred::x; // use qualified name to access fred::x
    > }

    Thank you, I got it now! Thanks!
    >
    >> I found the standard is too hard for non-english programmer!

    >
    > You'd be surprised how many English speaking programmers find it hard!
    > That's why we have so many text books.
    >

    I feel contented after looking this...
    Bo Yang, Dec 11, 2006
    #6
  7. Bo Yang

    Greg Guest

    Huck Phin wrote:
    > A qualified name is what combination and organization of letters,
    > numbers, and underscore you can use to declare a variable, function,
    > method, or class. To make it a qualified name, 2 things need to be
    > true:
    >
    > 1. In C++, you can use letters, digits, and underscore( _ ) in
    > declaring your variable name.
    > 2. Your variable cannot start with a number.
    >
    > 3 examples of Qualified Names are:
    > myDog
    > my_dog
    > my_dog3
    >
    > 3 examples of Unqualified Names are:
    > 123Dogs
    > 1Dog1
    > $my_dog ( All Special Characters cannot be used except underscore )


    Er, no. The first group contains unqualified names while the second
    group contains "ill-formed" names - that is, names that could not be
    used in a C++ program.

    A "qualified" name is a (legal) name prefixed with scope operator :):)
    and usually a class or namespace name as well. Since the same name can
    appear at different "scopes" in a C++ program, it is sometimes useful
    to use the scope operator to "qualify" the name as the one belonging to
    particular class or namespace - and not the identical name in some
    other namespace or class (and which the compiler would otherwise select
    if the name were not qualified.)

    These are examples of qualified names:

    A::b;
    A::B::c
    A::template X;
    ::a;

    A qualified name always has a scope operator "::" before the name. An
    "unqualfied" name has no scope operator - it's just a simple name.
    Since it's not clear in which scope an unqualified name is declared, a
    C++ compiler has to "look up" each unqualified name it encounters to
    find a matching declaration.

    Greg
    Greg, Dec 11, 2006
    #7
  8. Bo Yang

    Noah Roberts Guest

    Bo Yang wrote:
    > Hi,
    > I am now reading the C++ standard, and have some troubles.
    > What is unqualified name and what is qualified name?
    >
    > I found the standard is too hard for non-english programmer!


    That's ok, it's hard for english speaking (and reading) programmers as
    well.
    Noah Roberts, Dec 11, 2006
    #8
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. steve.leach

    How standard is the standard library?

    steve.leach, Apr 18, 2005, in forum: Python
    Replies:
    1
    Views:
    365
    Christos TZOTZIOY Georgiou
    Apr 18, 2005
  2. funkyj
    Replies:
    5
    Views:
    1,097
    funkyj
    Jan 20, 2006
  3. Bo Yang
    Replies:
    5
    Views:
    360
    kwikius
    Dec 17, 2006
  4. Replies:
    5
    Views:
    847
  5. Sriram Srinivasan
    Replies:
    13
    Views:
    538
    Benjamin Kaplan
    Nov 12, 2009
Loading...

Share This Page