C++????Щ??:????IO??
?????RonnyYoung ???????[ 2016/10/28 10:25:46 ] ????????C++ IO ??
????7??????????
????sstream??????????????????????????IO????Щ?????????stringд?????????string??????????string?????IO???????
????7.1 ???istringstream
????????????????????д???????????????????????????е?????????????????istringstream????????
???????磬????????????ζ????????????????е??????????????????vector?С?
????string line??word;
????while (getline(cin?? line))
????{
????vector<string> wordList;
????istringstream lineText(line);
????while (lineText >> word)
????{
????wordList.push_back(word);
????}
????}
????7.2 ???ostringstream
???????????????????????????????????ostringstream?????????????????????????????itoa??ftoa????????????????????
????int num1 = 42;
????double pi = 3.1415926;
????string str = "some numbers";
????ostringstream formatted;
????formatted << str << pi << num1;
????cout << formatted.str() << endl;
????????str?????????stringstream?м??????в???????
????string s;
????stringstream strm(s);// ????s????????????????????explicit???
????strm.str(); // ????strm???????string??????????
????strm.str(s); // ??s??????strm?У?????void??
????8?????????????? 8.1 ?????
???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????endl??????????????
???????????????????????????????????????????????????????????λ?????????????????????????????/??????????????????????????????????????????????????????臨??????????????????
????8.2 ????????????
???????????boolalpha?????bool???????true????true??false????false??????????noboolalpha????????????????????
????// modify boolalpha flag
????#include <iostream> // std::cout?? std::boolalpha?? std::noboolalpha
????int main () {
????bool b = true;
????std::cout << std::boolalpha << b << ' ';
????std::cout << std::noboolalpha << b << ' ';
????return 0;
????}
????8.3 ?????????????
????????????????????????????????????ò??????????????????????????????
????oct???????????
????hex??????????????
????dec????????????
??????????????showbase???????????????????8??????????0??????????????0x???????noshowbase???cout?????????????????????????????????????????16??????????д??0X FF???????ò????uppercase??nouppercase??????????????Сд????
????cout << uppercase << showbase << hex << 20 << 1024
????<< nouppercase << noshowbase << dec << endl;
????8.4 ????????????
????????????????precision????????setprecision??????????????precision??????????????????汾????int???????????????????????????????????????????汾????????????????????????setprecision?????????????????????????t????
??????scientific??????????????????fixed??????????????hexfloat???????????????????defaultfloat?????????????????
????????showpoint?????????????С????
????8.5 ???????
????setw??????????????????????С???
????left???????????????
????right?????????????????????????????
????internal???????????????λ???????????????????????????????????м???
????setfill????????????????????????????????????
????int i = -16;
????double d = 3.14159;
????cout << "i:" << setw(12) << i << ' '
????<< "d:" << setw(12) << d << ' ';
????cout << left
????<< "i:" << setw(12) << i << ' '
????<< "d:" << setw(12) << d << ' ';
????cout << right
????<< "i:" << setw(12) << i << ' '
????<< "d:" << setw(12) << d << ' ';
????cout << internal
????<< "i:" << setw(12) << i << ' '
????<< "d:" << setw(12) << d << ' ';
????cout << setfill('#')
????<< "i:" << setw(12) << i << ' '
????<< "d:" << setw(12) << d << ' '
????<< setfill(' ');
???????????????????????漰???????????????????SPASVOС??(021-61079698-8054)?????????????????????????
??????
??C++????????????C++ lvalue??rvalueC++11????????C++???????????????C++?е?????????????????C++?????????C++???Windows????λ??C/C++???????????????????JAVA??C??C++??????????c++??python???????????????????????????????C++???????C++?е????????C++????????????????C++ ???????????????C++?????????????????????C++????????????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11????????
?????????App Bug???????????????????????Jmeter?????????QC??????APP????????????????app?????е????????jenkins+testng+ant+webdriver??????????????JMeter????HTTP???????Selenium 2.0 WebDriver ??????