摘要: 仅仅记录贴,按书上的做完了一边,想把private分离出来已经很难了。因为is用到的成员变量都是直接当做public使用的,如果要改的话可以考虑存储输入,让后用构造函数对类进行初始化。#includeusing namespace std;class Sales_data{public: stri... 阅读全文
posted @ 2015-04-06 22:26 ashen~ 阅读(120) 评论(0) 推荐(0) 编辑
摘要: string s = "shen"; char *p = &s[0]; cout<<s<<endl <<s[0]<<endl <<*p<<endl; p++; cout<<*(++p)<<endl; 突然想到的,用指针操作string,新学c++,指针真的很NB,让我头都大了,老出错,上... 阅读全文
posted @ 2015-04-06 12:39 ashen~ 阅读(50) 评论(0) 推荐(0) 编辑
摘要: 1.int lookup(string p);2.int lookup(const string p);//同13.int lookup(string *);//传入一个指针,指针指向string类型4.int lookup(string * const p);//传入的是一个string,指针常量... 阅读全文
posted @ 2015-04-06 11:00 ashen~ 阅读(152) 评论(0) 推荐(0) 编辑