摘要:
int atoi(const char * str);函数说明参考:http://www.cplusplus.com/reference/clibrary/cstdlib/atoi/功能:将str里整数字符,翻成整数该函数:1:忽略开始的空白字符串,知道非空白的字符开始转换2:处理正负+ - 字符3:如果字符串为空,或者字符串里首字符不为数字或者正负号,不做转换Return ValueOn success, the function returns the converted integral number as anintvalue.If no valid conversion could 阅读全文
摘要:
15.1单词1:生成包含单词的列表,利用c++标准库提供的sets和strings从文件中分析出单词,并排序输出需要按序输出并统计词频,利用map容器 1 #include <iostream> 2 #include <fstream> 3 #include <string> 4 #include <map> 5 using namespace std; 6 void TokenWordFromTxt(map<string,int> &M,ifstream &in) 7 { 8 char *pch; 9 char *p 阅读全文