Click here to Skip to main content
15,918,109 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: enum in a switch statement Pin
ThatsAlok5-Jul-05 20:26
ThatsAlok5-Jul-05 20:26 
GeneralRe: enum in a switch statement Pin
Bob Stanneveld5-Jul-05 22:18
Bob Stanneveld5-Jul-05 22:18 
GeneralRe: enum in a switch statement Pin
ThatsAlok6-Jul-05 1:44
ThatsAlok6-Jul-05 1:44 
GeneralRe: enum in a switch statement Pin
Bob Stanneveld6-Jul-05 1:47
Bob Stanneveld6-Jul-05 1:47 
GeneralRe: enum in a switch statement Pin
Ista6-Jul-05 8:56
Ista6-Jul-05 8:56 
GeneralRe: enum in a switch statement Pin
Rick York6-Jul-05 11:46
mveRick York6-Jul-05 11:46 
GeneralRe: enum in a switch statement Pin
Ista6-Jul-05 11:51
Ista6-Jul-05 11:51 
GeneralRe: enum in a switch statement Pin
Bob Stanneveld6-Jul-05 20:40
Bob Stanneveld6-Jul-05 20:40 
Ista wrote:
Thanks for the detailed explanation.

You're welcome Big Grin | :-D


Ista wrote:
If its a namespaces how do I import the namespaces to use the enum?

You don't import namespaces like you do in .NET. You include the file that contains a part of the namespace rather than importing the entire namespace (which in turn can be spread across multiple files).


Ista wrote:
And how would I do the case statement with your solution?

As an other user already explained, the scope resolution operator (::) is used to get access to namespace declarations and / or static class members. The syntax is the same in this matter. The following code example demonstrates the syntax of namespaces and static class members:

namespace SomeNameSpace
{
    extern const int nSomeInt;
} // namespace SomeNameSpace

class SomeClass
{
public:
    static const int nSomeInt;
};

/*
    Somewhere in your code:
*/
// use the namespace int
int i = SomeNameSpace::nSomeInt;

// use the class int
int j = SomeClass::nSomeInt;


Ista wrote:
sorry for the lack of experience but I would like to know.

Don't be sorry for that! Everybody once lacked experiance. Smile | :) Eventually you'll get there!


Behind every great black man...
            ... is the police. - Conspiracy brother


Blog[^]
GeneralUsername n Password Pin
kireken5-Jul-05 19:10
kireken5-Jul-05 19:10 
GeneralRe: Username n Password Pin
Christian Graus5-Jul-05 19:33
protectorChristian Graus5-Jul-05 19:33 
GeneralRe: Username n Password Pin
kireken5-Jul-05 19:48
kireken5-Jul-05 19:48 
GeneralRe: Username n Password Pin
Christian Graus6-Jul-05 11:12
protectorChristian Graus6-Jul-05 11:12 
GeneralRe: Username n Password Pin
Anonymous6-Jul-05 19:46
Anonymous6-Jul-05 19:46 
GeneralRe: Username n Password Pin
Christian Graus6-Jul-05 23:06
protectorChristian Graus6-Jul-05 23:06 
Generalwrite text for read only Pin
Member 20973435-Jul-05 19:08
Member 20973435-Jul-05 19:08 
GeneralRe: write text for read only Pin
Christian Graus5-Jul-05 19:35
protectorChristian Graus5-Jul-05 19:35 
GeneralRe: write text for read only Pin
David Crow6-Jul-05 2:47
David Crow6-Jul-05 2:47 
GeneralRe: write text for read only Pin
Christian Graus6-Jul-05 11:15
protectorChristian Graus6-Jul-05 11:15 
QuestionHow to store RTP payload (G.711) to file? Pin
Ravi Sankar S5-Jul-05 18:35
Ravi Sankar S5-Jul-05 18:35 
AnswerRe: How to store RTP payload (G.711) to file? Pin
Jose Lamas Rios5-Jul-05 18:58
Jose Lamas Rios5-Jul-05 18:58 
AnswerRe: How to store RTP payload (G.711) to file? Pin
Alexander M.,6-Jul-05 3:15
Alexander M.,6-Jul-05 3:15 
GeneralRe: How to store RTP payload (G.711) to file? Pin
Ravi Sankar S10-Jul-05 19:53
Ravi Sankar S10-Jul-05 19:53 
GeneralRe: How to store RTP payload (G.711) to file? Pin
vikas amin15-Sep-05 2:13
vikas amin15-Sep-05 2:13 
GeneralUse Thread to update UI Pin
a_du5-Jul-05 18:26
a_du5-Jul-05 18:26 
GeneralRe: Use Thread to update UI Pin
sayup5-Jul-05 20:18
sayup5-Jul-05 20:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.