#include "iostream"
#include "cassert"//断言assert宏学院包含的文件。
using namespace::std;
void copydata(void *ptr1,void *ptr2)//
{
assert(ptr1&&ptr2);//断言ptr1和ptr2都不为空。
cout<<"继续执行赋值数据的代码....\n";
}
int main()
{
int ii=0,jj=0;
copydata(&ii,&jj);
//把ptr2中数据复制到ptr1中。
//静态断言。
// const int kk=0;
// static_assert(kk,"kk的值不合法。");
}
继续执行赋值数据的代码….
发表回复