#include <iostream>
using namespace std;
void func( void *p )
{
cout << "非const版本" << endl;
}
void func( const void *p )
{
cout << "const版本" << endl;
}
int main( void )
{
const int cpp = 2002;
func( &cpp );
int flash = 1500;
func( &flash );
system( "PAUSE" );
return EXIT_SUCCESS;
}
/*-------------------
const版本
非const版本
请按任意键继续. . .
---------------------------------*/
void*参数函数的const和非const重载函数版本
最新推荐文章于 2022-01-13 13:47:48 发布