Click here to Skip to main content
15,500,741 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: I hope there is a Managed C++/CLR person left to help me with Parallel::For Pin
madusmacus27-Jul-22 5:24
Membermadusmacus27-Jul-22 5:24 
QuestionUpgrade my skills... Pin
Kornfeld Eliyahu Peter21-Jul-22 1:45
professionalKornfeld Eliyahu Peter21-Jul-22 1:45 
AnswerRe: Upgrade my skills... Pin
Richard MacCutchan21-Jul-22 2:00
mveRichard MacCutchan21-Jul-22 2:00 
PraiseRe: Upgrade my skills... Pin
Kornfeld Eliyahu Peter21-Jul-22 2:12
professionalKornfeld Eliyahu Peter21-Jul-22 2:12 
GeneralRe: Upgrade my skills... Pin
Richard MacCutchan21-Jul-22 2:21
mveRichard MacCutchan21-Jul-22 2:21 
AnswerRe: Upgrade my skills... Pin
Graham Breach21-Jul-22 7:42
MemberGraham Breach21-Jul-22 7:42 
PraiseRe: Upgrade my skills... Pin
Kornfeld Eliyahu Peter21-Jul-22 8:07
professionalKornfeld Eliyahu Peter21-Jul-22 8:07 
Questionpointers to functions Pin
Calin Negru16-Jul-22 1:28
MemberCalin Negru16-Jul-22 1:28 
How do you use a pointer to a function that is declared in the general scope within a class.
Do you pass the pointer as parameter to class function, save the pointer as a class member and then use the class member in a class function when needed?



C++
void somefunction(int i);
void (*pointertosomef)(int i) = somefunction;

class SomeObject
{
void (*m_pointertosomef)(int i);
public:
void ImportPointerToF(void (*pointertosomef)(int i));
void UsePointerToF();
}

void SomeObject::ImportPointerToF(void (*pointertosomef)(int i))
{
m_pointertosomef = pointertosomef;
}
void SomeObject::UsePointerToF()
{
 m_pointertosomef(30);
}


I found on the internet the basic version of declaring a pointer function
C++
void fun(int a);

void (*fun_ptr)(int) = fun;  
  
    fun_ptr(10);

Everything else is my speculation
AnswerRe: pointers to functions Pin
Mircea Neacsu16-Jul-22 1:52
mvaMircea Neacsu16-Jul-22 1:52 
AnswerRe: pointers to functions Pin
Richard MacCutchan16-Jul-22 2:09
mveRichard MacCutchan16-Jul-22 2:09 
General[edited]Re: pointers to functions Pin
Calin Negru16-Jul-22 2:45
MemberCalin Negru16-Jul-22 2:45 
GeneralRe: [edited]Re: pointers to functions Pin
Mircea Neacsu16-Jul-22 5:26
mvaMircea Neacsu16-Jul-22 5:26 
GeneralRe: [edited]Re: pointers to functions Pin
Calin Negru16-Jul-22 5:40
MemberCalin Negru16-Jul-22 5:40 
GeneralRe: [edited]Re: pointers to functions Pin
Richard MacCutchan16-Jul-22 5:56
mveRichard MacCutchan16-Jul-22 5:56 
GeneralRe: [edited]Re: pointers to functions Pin
Calin Negru16-Jul-22 6:50
MemberCalin Negru16-Jul-22 6:50 
GeneralRe: [edited]Re: pointers to functions Pin
Richard MacCutchan16-Jul-22 7:01
mveRichard MacCutchan16-Jul-22 7:01 
GeneralRe: [edited]Re: pointers to functions Pin
Calin Negru16-Jul-22 7:57
MemberCalin Negru16-Jul-22 7:57 
GeneralRe: [edited]Re: pointers to functions Pin
Richard MacCutchan16-Jul-22 21:58
mveRichard MacCutchan16-Jul-22 21:58 
AnswerRe: pointers to functions Pin
Greg Utas16-Jul-22 8:36
mveGreg Utas16-Jul-22 8:36 
QuestionConvert decimal to binary in C Pin
sahil Ranka14-Jul-22 2:14
Membersahil Ranka14-Jul-22 2:14 
AnswerRe: Convert decimal to binary in C Pin
Mircea Neacsu14-Jul-22 2:25
mvaMircea Neacsu14-Jul-22 2:25 
AnswerRe: Convert decimal to binary in C Pin
Richard MacCutchan14-Jul-22 2:29
mveRichard MacCutchan14-Jul-22 2:29 
GeneralRe: Convert decimal to binary in C Pin
sahil Ranka14-Jul-22 3:42
Membersahil Ranka14-Jul-22 3:42 
AnswerRe: Convert decimal to binary in C Pin
CPallini14-Jul-22 3:36
mveCPallini14-Jul-22 3:36 
GeneralRe: Convert decimal to binary in C Pin
sahil Ranka14-Jul-22 3:42
Membersahil Ranka14-Jul-22 3:42 

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.