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
阅读全文
摘要:只要把你的函数写好并把地址传过去就行,至于如何调用你的函数,那你不需要管,调用部分的代码不是你写。#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
阅读全文
摘要: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
阅读全文
摘要:#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 &
阅读全文
摘要:#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 &
阅读全文
浙公网安备 33010602011771号