
c++
我是小沙
科研是把金钱转换为知识,而创新则是把知识转换为金钱。
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
c++中float和double转化为string
C++中float和double转换为string方法一:float f=4.345; sprintf(destination,"%f",f) std::string res = destination;方法二: 使用strstream头文件或sstream头文件。后者需将strstream换为stringstream。#include <strstream> std::strstream ss;原创 2016-11-24 13:38:25 · 4510 阅读 · 0 评论 -
两个类相互调用
两个类相互调用//A.h #include "B.h" class A { public: B b; }//A.cpp #include "A.h" class A{}//B.h extern class A; class B { public: A* a; }//B.cpp #include "B.h" #include "A.h" class B{}原创 2016-12-21 14:22:45 · 1494 阅读 · 2 评论 -
log文件的读写[转]
/** * 用于输出log文件的类. */ #ifndef LOG_H #define LOG_H //log文件路径 #define LOG_FILE_NAME "log.txt" //启用开关 #define LOG_ENABLE #include <fstream> #include <string> #include <ctim转载 2017-08-22 08:43:14 · 1817 阅读 · 0 评论