随笔分类 - C++
摘要:top-level const:变量或者引用自身不能被改变 int *const p = &a;//指针p不能被改变(p中储存的地址) const int val = 42;//变量val不能被改变 low-level const:变量引用或者指向地址不能改变 const int *p = &a;/
阅读全文
该文被密码保护。
摘要:今天在结构体中使用字符指针,莫名出现段错误。经过查询才知道是成员指针没有初始化! 看看错误代码: #include <bits\stdc++.h> #pragma warning(disable:4996) using namespace std; char s[2] = { 0 }; struct
阅读全文
摘要:这实际上就是一个头文件的集合,可以看看他的定义。 #ifndef _GLIBCXX_NO_ASSERT #include <cassert> #endif #include <cctype> #include <cerrno> #include <cfloat> #include <ciso646>
阅读全文
摘要:实现内容(屏幕,鼠标,键盘实时控制) 控制端: 1 #pragma once 2 3 #ifndef keybd_H 4 #define keybd_H 5 6 #include <stdio.h> 7 #include <stdlib.h> 8 9 int KeyBD(int tch) { 10
阅读全文
摘要:朋友让帮忙写一个文件处理的软件。 花了一天时间基本写好,最后卡在一个栈溢出问题。写贴出代码。 #include <stdio.h> #include <stdlib.h> #include <string.h> #include <iostream> #include <windows.h> #in
阅读全文

浙公网安备 33010602011771号