#31527: string 的3種宣告


09360493@me.mcu.edu.tw (pi_squareroot)


string 的3種宣告方式

1.

string  str("txt");

string  str="txt";

2.

string str1="test";

string str2(str1);

3.

string str(7,'*');

運用第三個宣告方式,可以一次打印指定數量字元