Click here to Skip to main content
15,438,643 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 4:24
Membermadusmacus27-Jul-22 4:24 
QuestionUpgrade my skills... Pin
Kornfeld Eliyahu Peter21-Jul-22 0:45
professionalKornfeld Eliyahu Peter21-Jul-22 0:45 
AnswerRe: Upgrade my skills... Pin
Richard MacCutchan21-Jul-22 1:00
mveRichard MacCutchan21-Jul-22 1:00 
PraiseRe: Upgrade my skills... Pin
Kornfeld Eliyahu Peter21-Jul-22 1:12
professionalKornfeld Eliyahu Peter21-Jul-22 1:12 
GeneralRe: Upgrade my skills... Pin
Richard MacCutchan21-Jul-22 1:21
mveRichard MacCutchan21-Jul-22 1:21 
AnswerRe: Upgrade my skills... Pin
Graham Breach21-Jul-22 6:42
MemberGraham Breach21-Jul-22 6:42 
PraiseRe: Upgrade my skills... Pin
Kornfeld Eliyahu Peter21-Jul-22 7:07
professionalKornfeld Eliyahu Peter21-Jul-22 7:07 
Questionpointers to functions Pin
Calin Cali16-Jul-22 0:28
MemberCalin Cali16-Jul-22 0: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 0:52
mvaMircea Neacsu16-Jul-22 0:52 
AnswerRe: pointers to functions Pin
Richard MacCutchan16-Jul-22 1:09
mveRichard MacCutchan16-Jul-22 1:09 
General[edited]Re: pointers to functions Pin
Calin Cali16-Jul-22 1:45
MemberCalin Cali16-Jul-22 1:45 
GeneralRe: [edited]Re: pointers to functions Pin
Mircea Neacsu16-Jul-22 4:26
mvaMircea Neacsu16-Jul-22 4:26 
GeneralRe: [edited]Re: pointers to functions Pin
Calin Cali16-Jul-22 4:40
MemberCalin Cali16-Jul-22 4:40 
GeneralRe: [edited]Re: pointers to functions Pin
Richard MacCutchan16-Jul-22 4:56
mveRichard MacCutchan16-Jul-22 4:56 
GeneralRe: [edited]Re: pointers to functions Pin
Calin Cali16-Jul-22 5:50
MemberCalin Cali16-Jul-22 5:50 
GeneralRe: [edited]Re: pointers to functions Pin
Richard MacCutchan16-Jul-22 6:01
mveRichard MacCutchan16-Jul-22 6:01 
GeneralRe: [edited]Re: pointers to functions Pin
Calin Cali16-Jul-22 6:57
MemberCalin Cali16-Jul-22 6:57 
GeneralRe: [edited]Re: pointers to functions Pin
Richard MacCutchan16-Jul-22 20:58
mveRichard MacCutchan16-Jul-22 20:58 
AnswerRe: pointers to functions Pin
Greg Utas16-Jul-22 7:36
mveGreg Utas16-Jul-22 7:36 
QuestionConvert decimal to binary in C Pin
sahil Ranka14-Jul-22 1:14
Membersahil Ranka14-Jul-22 1:14 
AnswerRe: Convert decimal to binary in C Pin
Mircea Neacsu14-Jul-22 1:25
mvaMircea Neacsu14-Jul-22 1:25 
AnswerRe: Convert decimal to binary in C Pin
Richard MacCutchan14-Jul-22 1:29
mveRichard MacCutchan14-Jul-22 1:29 
GeneralRe: Convert decimal to binary in C Pin
sahil Ranka14-Jul-22 2:42
Membersahil Ranka14-Jul-22 2:42 
AnswerRe: Convert decimal to binary in C Pin
CPallini14-Jul-22 2:36
mveCPallini14-Jul-22 2:36 
GeneralRe: Convert decimal to binary in C Pin
sahil Ranka14-Jul-22 2:42
Membersahil Ranka14-Jul-22 2: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.