![](https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
备忘
文章平均质量分 63
A_Little_Nut
这个作者很懒,什么都没留下…
展开
-
fstream,sstream的学习记录(备忘)
fstream: #include #include using namespace std; int main(){ ofstream os("C:\\Users\\Administrator\\Desktop\\ifile.txt",ios::app); //查看位置处是否有ifile.txt,若没有,程序自己建一个 //其中ios::app表示在原文件末尾追加 st原创 2017-11-30 12:15:22 · 360 阅读 · 0 评论 -
控制位数和填充0
如果是C语言那么用 printf("%05d", a); 如果是C++ #include #include //包括这个头文件 using namespace std; void main() { int a = 33; cout }原创 2017-12-16 18:01:43 · 623 阅读 · 0 评论 -
c和c++如何把一个整数转化为string
C++ 一、string转int的方式 采用最原始的string, 然后按照十进制的特点进行算术运算得到int,但是这种方式太麻烦,这里不介绍了。 采用标准库中atoi函数。 string s = "12"; int a = atoi(s.c_str()); 对于其他类型也都有相应的标准库函数,比如浮点型atof(),long型atol()等等。原创 2017-12-17 09:56:51 · 798 阅读 · 0 评论