习题参考答案(4)

2018-12-22 19:49

友元函数: #include #include class string{ private: };

string operator+=(string str1,string str2) {strcat(str1.s,str2.s); return str1;} void main()

{string ob1(\cout<<\cout<<\

cout<<\}

练习8(p228) 1、见教材相关内容 2、选择题

(1)B (2)B (3)C (4)A (5)B 3、写出结果(必要时上机验证) 4、填空题

(1)ofstream outfile、!outfile、outfile、outfile.close() (2)“data.dat”、outfile 5、6、

#include #include #include void main() {char *s1,ch; cin>>s1;

fstream file(\ file.write(s1,strlen(s1)); file.seekp(0,ios::beg); while(file.get(ch)) }

cout<

string(char *p=0){strcpy(s,p);} char *print(){return s;}

friend string operator+=(string str1,string str2); public:


习题参考答案(4).doc 将本文的Word文档下载到电脑 下载失败或者文档不完整,请联系客服人员解决!

下一篇:简析中国led灯产品的出口贸易问题及对策学位论文

相关阅读
本类排行
× 注册会员免费下载(下载后可以自由复制和排版)

马上注册会员

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: