摘要:1, class 和 struct 都可以定义一个类,区别是两者在所支持的 默认信息隐藏方式不同:c++ 中默认为 private 类型,而 struct 中默认为 public 类型。 2,类的私有成员具有 类范围 性质,仅能由类的成员函数访问。 3,类成员函数的定义有两种方式:(a)在类声明的时
阅读全文
摘要:c++ 程序出现 Error:stray '\243' in program 错误 错误情况: 错误原因: 有不标准的 ASCII 字符出现,一般是中英文问题,比如 ;or ; , or ,等 解决方法: 将程序中的 : > :(中文符号改为英文符号)
阅读全文
摘要:1, isalnum(): check whether c is either a decimal digit or an uppercase or lowercase letter. 2, isalpha 3, isblank(c++11) 4, iscntrl : check whether c
阅读全文
摘要:链表测试框架示例: 1 // leetcodeList.cpp : 定义控制台应用程序的入口点。vs2013 测试通过 2 // 3 4 #include "stdafx.h" 5 #include <Windows.h> 6 #include <iostream> 7 8 using namesp
阅读全文
摘要:1, VS2013 warning C4018 "<” 有符号/无符号不匹配" 警告 出错代码: void show(const vector<int>& nums){ for (int i = 0; i < nums.size(); i++){ cout << '\t' << nums[i]; }
阅读全文
摘要:step1: 在本地 hosts 文件增加一行,windows 路径一般为:C:\Windows\System32\drivers\etc step2: 输入激活码 7SPIY8PDT7-eyJsaWNlbnNlSWQiOiI3U1BJWThQRFQ3IiwibGljZW5zZWVOYW1lIjoi
阅读全文
摘要:1,removeDuplicates(I) 1 int removeDuplicatesI(vector<int>& nums){ // 重新组织数组,同 removeDuplicates2IV 2 int index = 0; 3 for(int i=0;i<nums.size();++i){ 4
阅读全文
摘要:题目参考教材:https://github.com/soulmachine/leetcode(leetcode-cpp.pdf)
阅读全文