01 2012 档案

摘要:class Ctest{public:void fun(){cout<<"fuck!"<<endl;}int nTest;};void (Ctest::*ptrFun)() = &Ctest::fun;int Ctest::*ptrTest = &Ctest::nTest;int main(){Ctest *ptrCtest = new Ctest();ptrCtest->*ptrTest = 100;cout<<ptrCtest->*ptrTest<<endl<<ptrCtest-&g 阅读全文
posted @ 2012-01-12 23:34 rookieeeeee 阅读(274) 评论(0) 推荐(0)
摘要:只要把你的函数写好并把地址传过去就行,至于如何调用你的函数,那你不需要管,调用部分的代码不是你写。#include <iostream>using namespace std;typedef void (*CALLBACK)(int a,int b);class base{private:int m;int n;static CALLBACK func;public:void registercallback(CALLBACK fun,int k,int j);void callcallback();};CALLBACK base::func=NULL;void base::reg 阅读全文
posted @ 2012-01-10 19:47 rookieeeeee 阅读(138) 评论(0) 推荐(0)
摘要:typedef struct node {int data1;char data2[10];node *next;}*ptrN;ptrN accessNode(const ptrN head,int n){ptrN tmpNode;if (head == 0){return 0;}else{tmpNode = head;}for (int i = 0;i < n-1; i++){if (tmpNode->next == 0){return 0;}tmpNode = tmpNode->next;}return tmpNode;}ptrN accessTrail(const pt 阅读全文
posted @ 2012-01-03 22:26 rookieeeeee 阅读(92) 评论(0) 推荐(0)
摘要:#include <afx.h>#include <iostream>#include <string>#include <vector>#include <io.h>#include <stdio.h>#include <fcntl.h>#include <boost/filesystem.hpp>#include <iostream> #include <boost/thread/thread.hpp> #include <string> #include & 阅读全文
posted @ 2012-01-03 19:25 rookieeeeee 阅读(181) 评论(0) 推荐(0)
摘要:#include <afx.h>#include <iostream>#include <string>#include <vector>#include <io.h>#include <stdio.h>#include <fcntl.h>#include <boost/filesystem.hpp>#include <iostream> #include <boost/thread/thread.hpp> #include <string> #include & 阅读全文
posted @ 2012-01-03 18:33 rookieeeeee 阅读(155) 评论(0) 推荐(0)