随笔分类 -  C++

摘要:class A{public: typedef int (*func)(int); operator func();};int ff(int a){ return a;}A::operator func(){ return ff;}int main () { cout<< A::func(9)<<e 阅读全文
posted @ 2017-04-07 19:01 于光远 阅读(325) 评论(0) 推荐(0)
摘要:数字转字符串: 用C++的streanstream: #include <sstream> #Include <string> string num2str(double i) { stringstream ss; ss << i; return ss.str(); } 字符串转数字: int st 阅读全文
posted @ 2016-12-01 14:55 于光远 阅读(520) 评论(0) 推荐(0)
摘要:string转int int转string 阅读全文
posted @ 2016-10-08 11:45 于光远 阅读(268) 评论(0) 推荐(0)
摘要:在制作dll的时候,如果全局变量不导出,而函数调用中,包含了全局变量,那么会出现全局变量没有值的问题。 add.c #pragma once //强制无签名utf-8 #include "add.h" pStu student;//全局变量 int add(int a, int b){ return 阅读全文
posted @ 2016-09-30 10:53 于光远 阅读(169) 评论(0) 推荐(0)
摘要:获取带有空格的输入 阅读全文
posted @ 2016-09-18 10:57 于光远 阅读(149) 评论(0) 推荐(0)