Click here to Skip to main content
15,881,852 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: enum Pin
Richard MacCutchan4-Sep-13 8:08
mveRichard MacCutchan4-Sep-13 8:08 
QuestionHow to genrate variable sound? Pin
Vaclav_3-Sep-13 12:42
Vaclav_3-Sep-13 12:42 
QuestionRe: How to genrate variable sound? Pin
David Crow3-Sep-13 16:47
David Crow3-Sep-13 16:47 
AnswerRe: How to genrate variable sound? Pin
Richard MacCutchan3-Sep-13 21:00
mveRichard MacCutchan3-Sep-13 21:00 
GeneralRe: How to genrate variable sound? Pin
Vaclav_5-Sep-13 7:08
Vaclav_5-Sep-13 7:08 
GeneralRe: How to genrate variable sound? Pin
Richard MacCutchan5-Sep-13 7:39
mveRichard MacCutchan5-Sep-13 7:39 
Questionenum usage question Pin
econy3-Sep-13 10:07
econy3-Sep-13 10:07 
AnswerRe: enum usage question Pin
pasztorpisti3-Sep-13 11:38
pasztorpisti3-Sep-13 11:38 
The enum members can have any int value. All of them can have the same value, they can have random order.
The only two "rules" that you have to know: If you don't define the value of the first enum member then its automatically 0. If you don't define the value of any of the other non-first enum members then their value is automatically the value of the previous member + 1. Using enums to declare constants in header files (even inside classes) is a good old trick. If you use the enum just to define constants then you dont have to give a name for the enum itself:
C++
enum {
 val0 = 5,
 val1 = 1,
 val3 = 4,
};


EDIT: The weekday enum itself is just a type. A type doesn't occupy any memory. If you declare/define a variable of that enum type then the variable occupies some memory, the same amount as an int variable:
C++
// These VARIABLE DECLARATIONS occupy space somewhere in memory. The Weekday type itself doesn't.

Weekday wd;
void func()
{
   Weekday w;
   // In plain c you have to say
   enum Weekday ww;
}

class C
{
private:
   Weekday m_Weekday;
};

QuestionCamStudio Project - Runs But Gives Debug Assertions Pin
Django_Untaken3-Sep-13 8:09
Django_Untaken3-Sep-13 8:09 
AnswerRe: CamStudio Project - Runs But Gives Debug Assertions Pin
Richard MacCutchan3-Sep-13 9:23
mveRichard MacCutchan3-Sep-13 9:23 
QuestionUsing CDHtmlDialog in MFC Dialog Pin
Don Guy2-Sep-13 7:47
Don Guy2-Sep-13 7:47 
SuggestionRe: Using CDHtmlDialog in MFC Dialog Pin
Richard MacCutchan2-Sep-13 21:35
mveRichard MacCutchan2-Sep-13 21:35 
AnswerRe: Using CDHtmlDialog in MFC Dialog Pin
Erudite_Eric3-Sep-13 3:43
Erudite_Eric3-Sep-13 3:43 
QuestionC++ code to create thread to handle method Pin
pk jain1-Sep-13 22:16
pk jain1-Sep-13 22:16 
AnswerRe: C++ code to create thread to handle method Pin
Richard MacCutchan1-Sep-13 23:01
mveRichard MacCutchan1-Sep-13 23:01 
AnswerRe: C++ code to create thread to handle method Pin
pasztorpisti1-Sep-13 23:25
pasztorpisti1-Sep-13 23:25 
GeneralRe: C++ code to create thread to handle method Pin
Erudite_Eric3-Sep-13 3:52
Erudite_Eric3-Sep-13 3:52 
GeneralRe: C++ code to create thread to handle method Pin
pasztorpisti3-Sep-13 4:22
pasztorpisti3-Sep-13 4:22 
GeneralRe: C++ code to create thread to handle method Pin
Erudite_Eric3-Sep-13 21:43
Erudite_Eric3-Sep-13 21:43 
GeneralRe: C++ code to create thread to handle method Pin
pasztorpisti3-Sep-13 22:00
pasztorpisti3-Sep-13 22:00 
GeneralRe: C++ code to create thread to handle method Pin
Erudite_Eric4-Sep-13 4:47
Erudite_Eric4-Sep-13 4:47 
GeneralRe: C++ code to create thread to handle method Pin
pasztorpisti4-Sep-13 4:51
pasztorpisti4-Sep-13 4:51 
GeneralRe: C++ code to create thread to handle method Pin
Erudite_Eric5-Sep-13 21:33
Erudite_Eric5-Sep-13 21:33 
GeneralRe: C++ code to create thread to handle method Pin
pasztorpisti5-Sep-13 22:38
pasztorpisti5-Sep-13 22:38 
AnswerRe: C++ code to create thread to handle method Pin
Erudite_Eric3-Sep-13 3:50
Erudite_Eric3-Sep-13 3:50 

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.