试试typedef函数指针相关的东西

烁灵 posted @ 2014年9月24日 11:27 in 未分类 , 989 阅读

作为回调

#include <iostream>
using namespace std;
class Clz{};
typedef void (Clz::*pot)();
class Sub : public Clz{
public:
	void test(){cout<<"test"<<endl;}
	pot pFun;
	void testCallback(){(this->*pFun)();}
};
int main() {
	// your code goes here
	Sub* sub = new Sub();
	sub->pFun = pot(&Sub::test);
	sub->testCallback();
	delete sub;
	return 0;
}

 

 

 

Avatar_small
ctu student portal 说:
2022年8月26日 10:47

Online students will find M.U.S.E. housed under student portals. Log in to your student portal now! Online · Denver South · ctu student portal Colorado Springs. Join one of CTU 2021. CTU Mobile by Colorado Technical University™ is a 2016 International E-Learning Award (IELA) winner for mobile learning: academic division. ctu student login portal.Online students will find M.U.S.E. housed under student portals. Log in to your student portal now! Online · Denver South ·

Avatar_small
TN 8th Previous Pape 说:
2022年8月26日 14:21

Tamilnadu English Medium Kalvisolai 8th Model Question Paper With Answers, Tamilnadu 8th Std. Model Question Paper, 6th Standard Model Question Paper Tamil Nadu Board Class 8th, Model Paper 2023, Download Tamil Medium, TN 8th Previous Paper 2023 English Medium-Wise, 8th Standard Tamil Medium Model Question Paper The steps to check the TNDGE 8th, Class Model Paper 2023, Pdf are provided here. How to Download TN High School Model Paper 2023. Visit the Tamil Nadu SSC Board's official results website.

Avatar_small
Alyssa 说:
2023年1月09日 13:11

A typedef is a keyword that is used in C and C++ to give a new name to a data type. The typedef keyword allows you to create custom data types that can be used to cheapest diamonds online make your code more readable and easier to understand. You can use the typedef keyword to give a new name to an existing data type, or to create a new data type.

Avatar_small
KSEB quick pay 说:
2023年1月19日 16:42

Kerala State Electricity Board formed by Kerala State Government under the Electricity act 1948. KSEB determined to generate, transmit and distribute the electricity in the regions of Kerala State. KSEB quick pay As a customer, you can use the KSEB online payment of the electricity department to update your pending dues for the electricity used. The bill may generat every month based on the reading grabbed from the electric meter fixed in your place that can be commercial or domestic.

Avatar_small
Emma 说:
2023年1月20日 19:25

Good to see the details you have shared here regarding the typedef function pointer-related stuff details you have shared here. It explains the function here cbd effects with some examples that help people to understand more about it. Keep sharing more details over here and keep up the good work.

Avatar_small
Safeway Near Me 说:
2023年1月27日 16:51

This is widely spread in the USA and they do have stores for grocery, fuel, and Pharmacy. The locate me icon on the official website does help you find any of the stores or fuel centers in a quick way. Safeway Near Me The shopping becomes easy, as they bring all vaults of products with multiple brands. The associates in Safe Way stores well prepared to support the customer’s during their shopping.

Avatar_small
CBSE 10th Sanple Pa 说:
2023年8月23日 17:56

Students who have Completed their Preparation can Start Practicing the CBSE 10th Class Guess Paper 2024. we Suggest the Students Solved Question Paper for Practice Purpose, in fact by Practicing Question Paper Students can get the brief idea about the Public Examination 2024.CBSE Examination will be Conducted in both Hindi and English Medium. we Request the Students to Check their CBSE 10th Sanple Paper 2024 Class Exam 2024 Date and Start their Preparation by Downloading the CBSE 10th Class Previous Paper Pdf. Actually, don’t Forget to refer the important Questions Subject Wise 2024 in order to get good marks in All the Subjects.

Avatar_small
jnanabhumiap.in 说:
2024年1月25日 23:45

JNANABHUMI AP provides all the latest educational updates and many more. The main concept or our aim behind this website has been the will to provide resources with full information on each topic jnanabhumiap.in which can be accessed through the Internet. To ensure that every reader gets what is important and worthy about the topic they search and link to hear from us.


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter