8.4发现忘记发上来了,现在补上。
8.4
#include#include //出问题时,使用的是cstring,但换成string一样出问题using namespace std;struct stringy{ char *str; int ct;};void set(stringy &beany,const char t[]);void show(const stringy &beany,int count=0);void show(const char t[],int count=0);void main84(){ stringy beany; char testing[]="Reality isn't what it used to be."; //char testing[]="Reality";//what it used to be."; set(beany,testing); show(beany); show(beany,2); testing[0]='D'; testing[1]='u'; show(testing); show(testing,3); show("Done!"); cout< <