Click here to Skip to main content
15,896,606 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Detect specific finger tip in convexhull Pin
Dilan Shaminda1-May-13 20:16
professionalDilan Shaminda1-May-13 20:16 
GeneralRe: Detect specific finger tip in convexhull Pin
Dilan Shaminda1-May-13 20:16
professionalDilan Shaminda1-May-13 20:16 
QuestionThe "hide_gui" key in the regedit , i want to know how does it works? Pin
ITboy_Lemon30-Apr-13 16:42
professionalITboy_Lemon30-Apr-13 16:42 
AnswerRe: The "hide_gui" key in the regedit , i want to know how does it works? Pin
Richard MacCutchan30-Apr-13 21:31
mveRichard MacCutchan30-Apr-13 21:31 
QuestionAccess structure variable value using string representing variable's name in C++. Pin
shanmugarajaa30-Apr-13 1:43
shanmugarajaa30-Apr-13 1:43 
AnswerRe: Access structure variable value using string representing variable's name in C++. Pin
Sivaraman Dhamodharan30-Apr-13 2:10
Sivaraman Dhamodharan30-Apr-13 2:10 
AnswerRe: Access structure variable value using string representing variable's name in C++. Pin
Chris Losinger30-Apr-13 4:07
professionalChris Losinger30-Apr-13 4:07 
AnswerRe: Access structure variable value using string representing variable's name in C++. Pin
Newbie0030-Apr-13 7:43
Newbie0030-Apr-13 7:43 
If you want to use c++ make a class instead of struct:

class CStudentInfo
{
public:
enum EVal
{
 erollnumEVal,
 emark1EVal,
 emark2EVal
};

int GetValue( EVal eVal )
{
  int iRetVal = 0;

  switch( eVal )
  {
    case erollnumEVal:
      iRetVal = rollnum;
      break; 

    case emark1EVal:
      iRetVal = mark1;
      break; 

    case emark2EVal:
      iRetVal = mark2;
      break; 

    default:
      ASSERT( FALSE );
      break; 
  }

 return iRetVal;
}

private:
 int rollnum;
 int mark1;
 int mark2;
} 


But why do you need something like this?

couldn't it be just simple:

class CStudentInfo
{
public:

int Getrollnum()
{
  return rollnum;
}

int Getmark1()
{
  return mark1;
}

int Getmark2()
{
  return mark2;
}

private:
 int rollnum;
 int mark1;
 int mark2;
}

AnswerRe: Access structure variable value using string representing variable's name in C++. Pin
jschell30-Apr-13 9:47
jschell30-Apr-13 9:47 
AnswerRe: Access structure variable value using string representing variable's name in C++. Pin
Stefan_Lang1-May-13 22:09
Stefan_Lang1-May-13 22:09 
QuestionCatch OnKeyDown in CDialog Pin
_Flaviu29-Apr-13 23:52
_Flaviu29-Apr-13 23:52 
AnswerRe: Catch OnKeyDown in CDialog Pin
Chris Losinger30-Apr-13 1:52
professionalChris Losinger30-Apr-13 1:52 
GeneralRe: Catch OnKeyDown in CDialog Pin
_Flaviu30-Apr-13 2:11
_Flaviu30-Apr-13 2:11 
QuestionReadfile to read parent process console buffer Pin
ForNow29-Apr-13 15:51
ForNow29-Apr-13 15:51 
AnswerRe: Readfile to read parent process console buffer Pin
«_Superman_»2-May-13 19:11
professional«_Superman_»2-May-13 19:11 
GeneralRe: Readfile to read parent process console buffer Pin
ForNow3-May-13 4:11
ForNow3-May-13 4:11 
QuestionNo more DSP but DSW and SLN in VC6.0 Pin
Vaclav_29-Apr-13 9:36
Vaclav_29-Apr-13 9:36 
QuestionRe: No more DSP but DSW and SLN in VC6.0 Pin
David Crow29-Apr-13 9:40
David Crow29-Apr-13 9:40 
AnswerRe: No more DSP but DSW and SLN in VC6.0 Pin
Vaclav_29-Apr-13 14:11
Vaclav_29-Apr-13 14:11 
GeneralRe: No more DSP but DSW and SLN in VC6.0 Pin
Richard MacCutchan29-Apr-13 23:11
mveRichard MacCutchan29-Apr-13 23:11 
GeneralRe: No more DSP but DSW and SLN in VC6.0 Pin
Vaclav_30-Apr-13 3:39
Vaclav_30-Apr-13 3:39 
GeneralRe: No more DSP but DSW and SLN in VC6.0 Pin
Richard MacCutchan30-Apr-13 6:09
mveRichard MacCutchan30-Apr-13 6:09 
GeneralRe: No more DSP but DSW and SLN in VC6.0 Pin
Freak3030-Apr-13 0:37
Freak3030-Apr-13 0:37 
GeneralRe: No more DSP but DSW and SLN in VC6.0 Pin
Vaclav_30-Apr-13 3:31
Vaclav_30-Apr-13 3:31 
AnswerRe: No more DSP but DSW and SLN in VC6.0 Pin
H.Brydon30-Apr-13 18:58
professionalH.Brydon30-Apr-13 18:58 

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.