![](https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C|C++
xhBruce
黑夜
双城
|
加法
减法
断舍离
展开
-
VSCode小技巧
1、安装Chinese插件。原创 2023-05-03 13:46:52 · 83 阅读 · 0 评论 -
非数组的指针
非数组的指针 C-风格字符串 #include <iostream> #include<cstring> using namespace std; int main() { cout << strlen("hello world") << " : " << "hello world" << endl; char hello[12] = {'h', 'e', 'l', 'l', 'o', ' ', 'w', 'o', 'r',原创 2021-08-01 14:13:52 · 199 阅读 · 0 评论 -
指针与数组
指针与数组 C 指向数组的指针 C++ 指向数组的指针 指针和地址 每一个变量都有一个内存位置,每一个内存位置都定义了可使用连字号(&)运算符访问的地址,它表示了在内存中的一个地址。 #include <iostream> using namespace std; int main() { int *p; int i; p = &i; *p = 17; cout << "i = " << i << endl; return 0原创 2021-07-09 23:36:02 · 133 阅读 · 0 评论 -
switch中break、“悬挂”else
switch中break switch的某个case中没有break,程序会顺序向下执行;既是优势所在,也是一大弱点;遗漏某个case的break,造成一些难以理解的程序行为。 #include <iostream> using namespace std; int main(void) { int color = 2; switch (color) { case 1: cout<< "red" << endl; break; case 2:原创 2021-07-09 20:59:49 · 336 阅读 · 0 评论 -
运算符优先级 - C++
运算符优先级 - C++ a & b != 0 实际上被解释为a & (b != 0),!=优先级高于& #include <iostream> using namespace std; int main(int argc, char** argv) { cout << "a & b != 0 : " << (1 & 2 != 0) << endl; cout << "a & b != 0原创 2021-07-04 16:14:17 · 217 阅读 · 2 评论 -
“贪心法”语句 - C/C++
“贪心法”语句 - C/C++ 每一个符号应该包含尽可能多的字符。即从左至右尽可能多的字符组成一个符号(“大嘴法”) a---b相当于a-- -b #include <iostream> using namespace std; int main(int argc, char** argv) { int a = 1; int b = 1; cout << "a---b " << a---b << endl; cout << "a:原创 2021-07-04 01:02:50 · 146 阅读 · 0 评论 -
tinyxml使用
tinyxml使用 http://www.grinninglizard.com/tinyxml/ https://sourceforge.net/projects/tinyxml/ GitHub:leethomason/tinyxml2 在线文档:TinyXml Documentation tinyxml 下载 tinyxml_2_6_2.zip 文档:tinyxml_2_6_2.zip/tinyxml/docs/index.html原创 2021-06-10 01:27:29 · 392 阅读 · 0 评论 -
VSCode编译C/C++
VSCode编译C/C++ visualstudio官网配置 下载安装 编辑工具 Visual Studio Code 编译环境 通过 SourceForge 网站安装 Mingw-w64 Mingw-w64安装下载超慢 下载地址:https://sourceforge.net/projects/mingw-w64/files/ 下载的文件找到最新版 "x86_64-posix-seh"下载压缩包 已经抓安装了C++的IDE(Dev C++等),找到对应安装的MinGW文件 配置path C:\原创 2021-06-10 00:57:39 · 1035 阅读 · 0 评论 -
=不同于== 和 &、| 不同于 &&、||
=不同于== #include <stdio.h> int main() { int x = 0; int y = 1; if(x == 0){ printf("one: %d \n",x); } if(x){ printf("two: %d \n",x); } if(x = y){ printf("three: %d \n",x); } x=0; y=1; if(x = 0 || y == 1){ printf("four: %d \n",原创 2021-04-30 23:32:00 · 164 阅读 · 1 评论 -
C/C++ 知识体系
C/C++ 知识体系 C/C++ IDE IDE - - VC++ 6.0 最开始使用VC++6.0,课程学习使用 下载 Dev C++ 蓝桥杯等比赛还是指定Dev C++为比赛的官方编译器;知乎讨论【为啥觉得Dev c++越来越难用?】 Bloodshed Dev-C++、小熊猫 Dev-C++@royqh1979、斑竹软件 Dev-C++@Anbang24 CLion jetbrains 商用IDE 下载 C/C++ 书籍 书名 - C++ Primer P原创 2021-04-30 22:06:06 · 844 阅读 · 2 评论