Chinaunix首页 | 论坛 | 博客
  • 博客访问: 307510
  • 博文数量: 214
  • 博客积分: 4258
  • 博客等级: 上校
  • 技术积分: 2021
  • 用 户 组: 普通用户
  • 注册时间: 2010-12-02 09:16
个人简介

http://blog.csdn.net/ly21st http://ly21st.blog.chinaunix.net

文章分类

全部博文(214)

文章存档

2018年(16)

2015年(1)

2014年(2)

2012年(22)

2011年(173)

发布时间:2011-11-30 13:46:34

#include <iostream>using namespace std;  struct Base {   static void statmem() {}}; struct Derived:Base {   void f(const Derived &);}; void Derived::f(const Derived &derived_obj).........【阅读全文】

阅读(407) | 评论(0) | 转发(0)

发布时间:2011-11-29 20:41:05

#include <iostream>#include <string>using namespace std; class Item_base {public:       Item_base(string& book,double f):isbn(book),price(f) {}       string book()       {.........【阅读全文】

阅读(201) | 评论(0) | 转发(0)

发布时间:2011-11-28 20:02:18

#include <iostream>#include <functional>#include <algorithm>#include <vector>using namespace std; int main(){    plus<int> add_int;     int sum=add_int(3,5);    cout<<"add_int(3,5)="<<sum<<endl;        int a[].........【阅读全文】

阅读(239) | 评论(0) | 转发(0)

发布时间:2011-11-26 20:33:17

C++重载箭头操作符的理解 今天看《C++ Primer》的成员访问操作符。看重载箭头操作符部分,刚开始有点迷茫,看了两遍总算有点理解,把心得写在这,与各位分享,如果有错误欢迎指正。箭头操作符(->)的通常用法是,使用一个类对象的指针来调用该指针所指对象的成员。左操作数为对象指针,右操作数为该对象的.........【阅读全文】

阅读(306) | 评论(0) | 转发(0)

发布时间:2011-11-26 15:44:28

#include <iostream>using namespace std;class HasPtr {   public:          HasPtr(const int &p,int i): ptr(new int(p)),val(i) {}          HasPtr(const HasPtr& rptr):ptr(new int(*rptr.ptr)),val.........【阅读全文】

阅读(209) | 评论(0) | 转发(0)
给主人留下些什么吧!~~
留言热议
请登录后留言。

登录 注册