10 2021 档案
摘要:#include <iostream> using namespace std; int g_base_num = 1; class Teacher { public: int id; int* studentIds{nullptr}; int count; public: // 构造函数 Teac
阅读全文
摘要:#include <iostream> #include <string> using namespace std; class Array { public: Array() { length = 0; num = NULL; }; Array(int n); int& operator[](in
阅读全文
摘要:C 库函数 - longjmp() C 标准库 - <setjmp.h> 描述 C 库函数 void longjmp(jmp_buf environment, int value) 恢复最近一次调用 setjmp() 宏时保存的环境,jmp_buf 参数的设置是由之前调用 setjmp() 生成的。
阅读全文
摘要:#include <stdlib.h> #include <iostream> #include <string> using namespace std; class Person { public: Person() { id = 0; name = nullptr; cout << "cons
阅读全文
摘要:int main() { string t1("abcd"); string t2; // x, y指向的地址相同(字符串存放到常量区,看下方图示), 存放x, y本身的地址是不相同的, const char* x = "abcd"; const char* y = "abcd"; char des
阅读全文
摘要:在C++中,以下代码给出了编译器错误: void destruct1 (int * item) { item->~int(); } 这段代码几乎相同,我只是将int定义为另一种类型,并且发生了一些魔术: #include <iostream> using namespace std; typedef
阅读全文
摘要:#include <malloc.h> #include <stdio.h> #include <iostream> #include <string> class Student { public: int id; std::string name; }; int main(int argc, c
阅读全文
摘要:#include <string.h> #include <iostream> using namespace std; struct TestStruct { char *a{nullptr}; char *b{nullptr}; char *c{nullptr}; int id; }; int
阅读全文
摘要:#include <iostream> #include <cassert> using namespace std; int main(int argc, char const* argv[]) { int a = 123; int b = 123; assert(a != b); cout <<
阅读全文
摘要:https://docs.microsoft.com/zh-cn/windows/wsl/troubleshooting
阅读全文
摘要:问题描述今天在写 C++ 代码的时候用上 C++11 的特性,然后发现 VSCode 虽然可以编译通过,但是会在相应位置报红,如下图所示。 并且在编译的时候遇到如下警告: C1.cpp:62:14: warning: 'auto' type specifier is a C++11 extensio
阅读全文
摘要:设置 按下win键,直接搜索启用或关闭Windows功能 打开后,在弹框中选择 ”适用于linux的windows子系统“ 材料准备 【 LxRunOffline 】下载地址:https://github.com/DDoSolitary/LxRunOffline/releases (可以选择最新版本
阅读全文
摘要:PostgreSQL实现了四种执行策略:(1)PORTAL_ONE_SELECT:如果用户提交的SQL语句中仅包含一个SELECT类型查询,则查询执行器会使用执行器来处理该SQL语句。换句话说,这种策略用于处理仅有一个可优化原子操作的情况。(2)PORTAL_ONE_RETURNING(PORTAL
阅读全文