Click here to Skip to main content
       

C / C++ / MFC

 
GeneralRe: Stuck with function pointers in C and C++ PinmemberStefan_Lang29-Jan-13 1:02 
GeneralRe: Stuck with function pointers in C and C++ PinmemberSimon Langdon29-Jan-13 1:38 
GeneralRe: Stuck with function pointers in C and C++ PinmemberStefan_Lang29-Jan-13 5:31 
GeneralRe: Stuck with function pointers in C and C++ PinmvpCPallini25-Jan-13 3:04 
Freak30 wrote:
If I remember correctly, you can't declare a pointer to a non-static member function in native C++

Actually you can, e.g.
#include<iostream>
using namespace std;
 
class A
{
  int i;
public:
  A(int i):i(i){}
  void show() { cout << i << endl;}
};
 
void  (A::*pmfn)();
 
int main()
{
  A  a(7);
 
  pmfn = &A::show;
 
  (a.*pmfn)();
}
 
However (and of course) this kind of pointer is not compatible with C-like function pointers.
Veni, vidi, vici.

GeneralRe: Stuck with function pointers in C and C++ PinmemberFreak3028-Jan-13 0:30 
AnswerRe: Stuck with function pointers in C and C++ PinmemberStephen Hewitt27-Jan-13 5:40 
QuestionUSB Device Path Handle Problem Pinmemberyogeshs24-Jan-13 22:21 
AnswerRe: USB Device Path Handle Problem PinmemberVaclav_Sal28-Jan-13 11:08 
QuestionHow to create a button on the right of the screen in mfc.? Pinmembermbatra3124-Jan-13 20:53 
AnswerRe: How to create a button on the right of the screen in mfc.? PinmvpRichard MacCutchan24-Jan-13 23:47 

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

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


Advertise | Privacy | Mobile
Web02 | 2.8.141223.1 | Last Updated 24 Dec 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid