
C++
大望dawang
软件开发工程师
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
C++ 多线程题目练习总结
C++ 多线程练习题目总结原创 2022-10-04 09:55:13 · 412 阅读 · 0 评论 -
string、const char*、 char* 、char[]相互转换
1.变成string,直接赋值。2、char[]变成别的,直接赋值。3、char*变constchar*容易,constchar*变char*麻烦。(constchar*);4、string变char*要通过constchar*中转。5、变成char[]。string逐个赋值,char*constchar*strncpy_s()原创 2022-07-24 10:18:59 · 702 阅读 · 0 评论 -
printf sprintf 和fprintf
printf sprintf 和fprintf的不同原创 2022-07-05 11:08:00 · 163 阅读 · 0 评论 -
thread-陷阱
thread 陷阱原创 2022-04-13 23:01:49 · 444 阅读 · 0 评论 -
C/C++开发中常见的数据类型
基本数据类型介绍原创 2022-02-17 11:28:52 · 292 阅读 · 0 评论 -
[c/c++精选题目]05-四种类型转换
在C++中有四种类型转换,分别是const_cast , static_cast , dynamic_cast , reinterpret_cast C风格的强制转换(Type Cast)容易理解,不管什么类型的转换都可以使用使用下面的方式 TypeName b = (TypeName)a; 但是以上转换有很大的缺点: 有的时候用c风格的转换是不合适的,因为它可以在任意类型之间转换,比如你可以把一个指向const对象的指针转换成指向非 const对象的指针,把一个指向基类对象的指针转换成指向一个派生类对原创 2021-07-13 15:51:45 · 442 阅读 · 0 评论 -
静态库和动态库
https://www.cnblogs.com/skynet/p/3372855.html原创 2021-05-29 16:47:34 · 88 阅读 · 0 评论 -
int ,char*,const char* ,string 之间的转换
原创 2020-08-13 15:44:55 · 307 阅读 · 0 评论 -
为什么c++中要分为heap(堆)和stack(栈)?
堆,英文是 heap,在内存管理的语境下,指的是动态分配内存的区域。这个堆跟数据结构里的堆不是一回事。这里的内存,被分配之后需要手工释放,否则,就会造成内存泄漏。 参考资料 https://www.zhihu.com/question/281940376 ...原创 2020-07-31 13:50:51 · 249 阅读 · 0 评论 -
打印二叉树C++
作者:知乎用户 链接:https://www.zhihu.com/question/280630276/answer/415783268 来源:知乎 著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。 struct node {int value; struct node *left, *right; }; // 一个数组,数组长度不低于二叉树的高度,为了简便起见,这里假设是一百, // 自己使用得时候可以改成动态数组(或链表) int vec_left[100] = {0}; //.原创 2020-07-29 15:23:13 · 2023 阅读 · 3 评论 -
关于C++ const 的全面总结
https://blog.youkuaiyun.com/Eric_Jo/article/details/4138548原创 2020-07-13 08:58:57 · 134 阅读 · 0 评论 -
const int 和int const
The trick is to read the declaration backwards (right-to-left): const int a = 1; // read as "a is an integer which is constant" int const a = 1; // read as "a is a constant integer"Both are the same thing. Therefore: a = 2; // Can't do because a is const原创 2020-07-12 23:46:24 · 2015 阅读 · 0 评论 -
[MFC]学习笔记
模态对话框-只能对一个对话框操作,不能对其他对话框操作。 c++ #ifdef的用法--https://www.cnblogs.com/wanqieddy/p/4377937.html原创 2020-03-08 21:08:51 · 120 阅读 · 0 评论 -
[C++]面试题,持续跟新中...
已知int x = 5;执行下列语句后,x的值为 x+=x-=x*x 先算x-=x*x,得x=5-5*5,x=-20;再算x+=x;得出x=40 请问下列代码的输出结果是什么? int m[] = {1,2,3,4,5,6,7,8,9,0}; int(*p)[4] = (int(*)[4])m; printf("%d",p[1][2]); 指针数组和数组指...原创 2019-09-16 14:59:19 · 183 阅读 · 0 评论 -
[C++] 超级详细的#if, #ifdef, #ifndef, #else, #elif, #endif的用法
#ifdef的用法 灵活使用#ifdef指示符,我们可以区隔一些与特定头文件、程序库和其他文件版本有关的代码。 代码举例:新建define.cpp文件 #include "iostream.h" int main() { #ifdef DEBUG cout<< "Beginning execution of main()"; #endif retu...原创 2019-05-21 18:18:56 · 2987 阅读 · 0 评论