函数模板不能用..重载也是c++
#include<stdio.h>
void *add(void *x,void *y,char ch )
{
if(ch=='i')
int *p=(int *) x;
if( ch =='l')
long *p=(long *) x;
if(ch =='f')
float *p=(float *) x;
if(ch =='d')
double *p=(double *) x;
return x;
}
int main()
{
float a=1;
float b=*((float *)add(&a,&a,'f'));
printf("%f\n",b);
return 0;
}
CWinThread* AfxBeginThread( AFX_THREADPROC pfnThreadProc, LPVOID pParam, int nPriority = THREAD_PRIORITY_NORMAL, UINT nStackSize = 0, DWORD dwCreateFlags = 0, LPSECURITY_ATTRIBUTES lpSecurityAttrs = NULL );
有点像这个..楼上楼上说的com组件没用过..呵呵..但是看到原形也还好了...
[[it] 本帖最后由 sunkaidong 于 2008-4-29 22:55 编辑 [/it]]