structSTRING
{
char*str;//字符指標指向字串
intct;//字串的長度
};
//定義函式setshow
voidset()//添加函式引數
{
inti=0;
for(;pstr[i];i++)
str.ct=i;
str.str=newchar[i];
//按要求3補充代碼
}
voidshow()//補充引數和執行代碼
voidshow()//補充引數和執行代碼
intmain()
{
STRINGstr;
charstr_1[]="helloworld";
set(str,str_1);//注意(1)第一個引數是參考
//(2)分配空間給STRING中str(3)把str_1中的資料復制到str中
//(4)計算ct=字串大小
show(str);//輸出str字串
show(str,3);//輸出str前三個字符
show(str_1);//輸出str_1
show(str_1,3);//輸出str_1前三個字符
show("finished");
return0;
}
沒
uj5u.com熱心網友回復:
有人嗎有人幫幫忙嗎
uj5u.com熱心網友回復:
有人嗎有人嗎uj5u.com熱心網友回復:
大家快來救命啊uj5u.com熱心網友回復:
要求是什么???轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/108780.html
標籤:C++ 語言
下一篇:double n;
