473,386 Members | 1,715 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Help on reading the standard!

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!
Dec 11 '06 #1
7 1213
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.

Dec 11 '06 #2
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

Dec 11 '06 #3
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.
Dec 11 '06 #4
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.
Dec 11 '06 #5
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...
Dec 11 '06 #6
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

Dec 11 '06 #7

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.

Dec 11 '06 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Tom | last post by:
OK I'm trying to go to the end of a file and delete the contents upwards until I meet a certain character. How can I do this? (NOTE: I'm using text files)
1
by: Hafeez | last post by:
I am having real trouble compiling this code http://www.cs.wisc.edu/~vganti/birchcode/codeHier/AttrProj.tgz The attachment shows errors when compiled using the current version of g++ in a...
18
by: Jeremy Weiss | last post by:
I'm trying to build a database that will handle the monthly billing needs of a small company. I'm charting everything out and here's what I see: table for customers sub table to track payments...
1
by: Rahul | last post by:
Hi Everybody I have some problem in my script. please help me. This is script file. I have one *.inq file. I want run this script in XML files. But this script errors shows . If u want i am...
4
by: Sreekanth | last post by:
Hi all, I have implemented a timing out version of fgets function call. I am pasting the entire code below. I have following doubts: 1. The code which I have written does it follow standard C...
66
by: genestarwing | last post by:
QUESTION: Write a program that opens and read a text file and records how many times each word occurs in the file. Use a binary search tree modified to store both a word and the number of times it...
22
by: Amali | last post by:
I'm newdie in c programming. this is my first project in programming. I have to write a program for a airline reservation. this is what i have done yet. but when it runs it shows the number of...
5
by: Sam | last post by:
Hi, I have one table like : MyTable {field1, field2, startdate, enddate} I want to have the count of field1 between startdate and enddate, and the count of field2 where field2 = 1 between...
5
by: shanti | last post by:
hai, i have developed a c-code to push integers into a stack (an array). in the program there are three inputs which has to be given through keyboard. the inputs are "choice", "option","S_R_NO"...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.