C/C++
楼兰剑客
这个作者很懒,什么都没留下…
展开
-
字符串常量和字符串变量C++
#include <iostream>#include <string>using namespace std;int main(){ string s1 = "abc";//字符串变量 char* s2 = "abc";//字符串常量,先在常量区存储"abc",s2直接指向常量区的&am原创 2018-08-15 14:16:01 · 3234 阅读 · 0 评论 -
前缀、中缀、后缀表达式转换C++
#include <iostream>#include <stack>#include <cctype>using namespace std;//优先级 int you(char c){ if(c=='+'||c=='-') return 0; else return 1;}//中缀转前缀,从后...原创 2018-08-14 23:04:21 · 1239 阅读 · 0 评论 -
AVL平衡二叉树C++版
#include <iostream>using namespace std;class AVLNode{public: int data; int height;//结点的高度,叶子结点高度为1 AVLNode* lChild; AVLNode* rChild;public: AVLNode(int data):data(data)...原创 2018-08-12 15:59:44 · 259 阅读 · 0 评论 -
二叉搜索树C++版
#include <iostream>using namespace std;class BTNode{public: int data; BTNode* lChild; BTNode* rChild; BTNode(int data):data(data), lChild(nullptr), rChild(nullptr){}};clas...原创 2018-08-11 16:20:35 · 137 阅读 · 0 评论 -
C++中数组指针
int main(int argc, char *argv[]) { int arr[] = {1, 2, 3}; printf("%p\n", arr);//000000000062FE40 printf("%p\n", arr + 1);//000000000062FE44 printf("%p\n", &arr);//000000000062FE40...原创 2019-04-15 21:20:57 · 395 阅读 · 0 评论 -
feof和EOF
EOF:文件末尾有EOF标志feof函数判断光标后还有没有字符(包括EOF字符)原创 2019-04-16 18:28:29 · 283 阅读 · 0 评论