Hello everyone,
Suppose I have two enums which has an item with the same names -- but
different values, -
enum foo {
-
-
NAME = 100;
-
}
-
-
enum goo {
-
-
NAME = 200;
-
}
-
Are there any ways to specify whether I need to access NAME in foo or NAME
in goo?
thanks in advance,
George 6 1405
You have to put them in different namespaces, otherwise the code doesn't
compile. If you do that, you can refer enum values using namespace name.
Regards
--
Cholo Lennon
Bs.As.
ARG
"George" <Ge****@discussions.microsoft.comwrote in message
news:88**********************************@microsof t.com...
Hello everyone,
Suppose I have two enums which has an item with the same names -- but
different values,
-
enum foo {
-
NAME = 100;
-
}
-
enum goo {
-
NAME = 200;
-
}
-
Are there any ways to specify whether I need to access NAME in foo or NAME
in goo?
thanks in advance,
George
BTW... this is a newsgroup for C++ CLI so I suppose that you're using it. You
can use 'enum class' instead of C++ enum. Enum class values don't have the
problem of scope visibility (present in C++ enum values).
Regards
--
Cholo Lennon
Bs.As.
ARG
"Cholo Lennon" <ch*********@hotmail.comwrote in message
news:#c**************@TK2MSFTNGP04.phx.gbl...
You have to put them in different namespaces, otherwise the code doesn't
compile. If you do that, you can refer enum values using namespace name.
Regards
--
Cholo Lennon
Bs.As.
ARG
"George" <Ge****@discussions.microsoft.comwrote in message
news:88**********************************@microsof t.com...
Hello everyone,
Suppose I have two enums which has an item with the same names -- but
different values, -
enum foo {
-
-
NAME = 100;
-
}
-
-
enum goo {
-
-
NAME = 200;
-
}
-
Are there any ways to specify whether I need to access NAME in foo or NAME
in goo?
thanks in advance,
George
Thanks Cholo,
It works! Cool!
regards,
George
"Cholo Lennon" wrote:
You have to put them in different namespaces, otherwise the code doesn't
compile. If you do that, you can refer enum values using namespace name.
Regards
--
Cholo Lennon
Bs.As.
ARG
"George" <Ge****@discussions.microsoft.comwrote in message
news:88**********************************@microsof t.com...
Hello everyone,
Suppose I have two enums which has an item with the same names -- but
different values, -
enum foo {
-
-
NAME = 100;
-
}
-
-
enum goo {
-
-
NAME = 200;
-
}
-
Are there any ways to specify whether I need to access NAME in foo or NAME
in goo?
thanks in advance,
George
Hi Cholo,
Could you recommend me a better newsgroup which is more suitable for my
question please? Thanks.
regards,
George
"Cholo Lennon" wrote:
BTW... this is a newsgroup for C++ CLI so I suppose that you're using it. You
can use 'enum class' instead of C++ enum. Enum class values don't have the
problem of scope visibility (present in C++ enum values).
Regards
--
Cholo Lennon
Bs.As.
ARG
"Cholo Lennon" <ch*********@hotmail.comwrote in message
news:#c**************@TK2MSFTNGP04.phx.gbl...
You have to put them in different namespaces, otherwise the code doesn't
compile. If you do that, you can refer enum values using namespace name.
Regards
--
Cholo Lennon
Bs.As.
ARG
"George" <Ge****@discussions.microsoft.comwrote in message
news:88**********************************@microsof t.com...
Hello everyone,
>
>
Suppose I have two enums which has an item with the same names -- but
different values,
> -
enum foo {
-
>
-
NAME = 100;
-
}
-
>
-
enum goo {
-
>
-
NAME = 200;
-
}
-
>
Are there any ways to specify whether I need to access NAME in foo or NAME
in goo?
>
>
thanks in advance,
George
- microsoft.public.vc.language
- microsoft.public.vc.atl (for your question about COM)
Regards
--
Cholo Lennon
Bs.As.
ARG
"George" <Ge****@discussions.microsoft.comwrote in message news:CB**********************************@microsof t.com...
Hi Cholo,
Could you recommend me a better newsgroup which is more suitable for my
question please? Thanks.
regards,
George
"Cholo Lennon" wrote:
BTW... this is a newsgroup for C++ CLI so I suppose that you're using it. You
can use 'enum class' instead of C++ enum. Enum class values don't have the
problem of scope visibility (present in C++ enum values).
Regards
--
Cholo Lennon
Bs.As.
ARG
"Cholo Lennon" <ch*********@hotmail.comwrote in message
news:#c**************@TK2MSFTNGP04.phx.gbl...
You have to put them in different namespaces, otherwise the code doesn't
compile. If you do that, you can refer enum values using namespace name.
>
Regards
>
--
Cholo Lennon
Bs.As.
ARG
>
>
"George" <Ge****@discussions.microsoft.comwrote in message
news:88**********************************@microsof t.com...
Hello everyone,
Suppose I have two enums which has an item with the same names -- but
different values, -
enum foo {
-
-
NAME = 100;
-
}
-
-
enum goo {
-
-
NAME = 200;
-
}
-
Are there any ways to specify whether I need to access NAME in foo or NAME
in goo?
thanks in advance,
George
>
>
Thanks Cholo!
regards,
George
"Cholo Lennon" wrote:
- microsoft.public.vc.language
- microsoft.public.vc.atl (for your question about COM)
Regards
--
Cholo Lennon
Bs.As.
ARG
"George" <Ge****@discussions.microsoft.comwrote in message news:CB**********************************@microsof t.com...
Hi Cholo,
Could you recommend me a better newsgroup which is more suitable for my
question please? Thanks.
regards,
George
"Cholo Lennon" wrote:
BTW... this is a newsgroup for C++ CLI so I suppose that you're using it. You
can use 'enum class' instead of C++ enum. Enum class values don't have the
problem of scope visibility (present in C++ enum values).
>
Regards
>
--
Cholo Lennon
Bs.As.
ARG
>
>
"Cholo Lennon" <ch*********@hotmail.comwrote in message
news:#c**************@TK2MSFTNGP04.phx.gbl...
You have to put them in different namespaces, otherwise the code doesn't
compile. If you do that, you can refer enum values using namespace name.
Regards
--
Cholo Lennon
Bs.As.
ARG
"George" <Ge****@discussions.microsoft.comwrote in message
news:88**********************************@microsof t.com...
Hello everyone,
>
>
Suppose I have two enums which has an item with the same names -- but
different values,
> -
enum foo {
-
>
-
NAME = 100;
-
}
-
>
-
enum goo {
-
>
-
NAME = 200;
-
}
-
>
Are there any ways to specify whether I need to access NAME in foo or NAME
in goo?
>
>
thanks in advance,
George
>
>
>
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: mcdonamw |
last post by:
This may sound like a stupid stupid question and I figure it would b
more "general" than pertaining to a specific Language.
I'm using vb.net and I have a bunch of Const values in my program.
can...
|
by: christopherlmarshall |
last post by:
Suppose you want to write a subclass of some existing class you are
importing from a module you didn't write and that you don't want to
study the internals of, and you want to define a data member...
|
by: LoopyNZ |
last post by:
Hi,
(Access 97)
I'm creating a query (QRY_SUMMARY) to join a query (QRY) to itself
(QRY_1). I'm returning QRY.* and selected fields from QRY_1. With each
field (field_name) I return from...
|
by: Alex Stevens |
last post by:
Hi All,
In the absence of any predefined standards, I was wondering how to name and
implement my enum in a class.
My dilema is:
When I (for example) have an integer property in my class...
|
by: Don |
last post by:
How do I get an Enum's type using only the Enum name?
e.g.
Dim enumType as System.Type
Dim enumName as String = "MyEnum"
enumType = ???(enumName)
|
by: thetrueaplus |
last post by:
Hey.
I'm trying to make a couple of enums work, however mingW isn't
compiling it because it says the previous declaration of none
conflicts. is there a way to solve this?
namespace Namespace...
|
by: Rico |
last post by:
Hello,
I'm looking for a way to reference the string name of an enumerator. I know
in VB.net you can do "MyEnum.ToString" and get the name instead of the
integer value. Is there a way I can do...
|
by: Sin Jeong-hun |
last post by:
Hello.
Speical folders, like Desktop, usually have different display names.
For example, in Japanese Windows, it's displayed as "$B%G%9%/%H%C%W(B". I want
to get the this displayed name of a...
|
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,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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$) {
}
...
|
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...
|
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
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |