![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C++基础
小洲实验室
这个作者很懒,什么都没留下…
展开
-
c++对txt文件的读取和写入
#include #include #include using namespace std; int main(){ char buffer[256]; ifstream myfile ("c://a.txt"); ofstream outfile("c://b.txt"); if(!myfile){ cout << "Unable to open myfile";转载 2015-05-25 13:43:58 · 1246 阅读 · 0 评论 -
标准c++中string类函数介绍
标准c++中string类函数介绍 注意不是CString 之所以抛弃char*的字符串而选用C++标准程序库中的string类,是因为他和前者比较起来,不必 担心内存是否足够、字符串长度等等,而且作为一个类出现,他集成的操作函数足以完成我们大多数情况下(甚至是100%)的需要。我们可以用 = 进行赋值操作,== 进行比较,+ 做串联(是不是很简单?)。我们尽可以把它看成是C转载 2015-05-25 15:30:21 · 2838 阅读 · 1 评论