摘要: 声明一个函数指针时,同时也需要提供构造一个函数需要的所有信息——包括函数的返回值和形式参数列表 typedef Int(*double IntFunction)(double); Double IntFunction fun(ptr); void printfloat(float data) { c 阅读全文
posted @ 2017-06-05 17:39 稻草人部落 阅读(108) 评论(0) 推荐(0) 编辑
摘要: Line *Line_ptr; //声明Line类的对象指针变量Line_ptr; Line l1; //声明Line类实例对象L1 Line_ptr=&L1; //取L1的地址赋值给Line_ptr; int getlength() { return length; } cout<<Line_pt 阅读全文
posted @ 2017-06-05 17:32 稻草人部落 阅读(106) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 using namespace std; 4 void sort(int data[],int length) 5 { 6 for(int i=0;idata[j+1]) 11 { 12 swap(data[j],data[j+1]); 13 }... 阅读全文
posted @ 2017-06-05 17:23 稻草人部落 阅读(269) 评论(0) 推荐(0) 编辑