上一页 1 ··· 5 6 7 8 9 10 11 下一页
摘要: 1 递归需要满足的两个条件:(1)有反复执行的过程(调用自身);(2)有跳出反复执行过程的条件(递归出口)。2 递归经典例子:(1) 阶乘n!=n*(n-1)*(n-2)*...1(n>0)int recursive(int n){ int result=0; ... 阅读全文
posted @ 2016-03-26 13:32 牧羊少年10号 阅读(190) 评论(0) 推荐(0) 编辑
摘要: 在Dlg.h文件中加入 #include using namespace std;extern vector aaa; 再在Dlg.cpp文件中加入vector aaa; 详情参考http://bbs.csdn.net/topics/390573469 ... 阅读全文
posted @ 2016-03-15 10:24 牧羊少年10号 阅读(1136) 评论(0) 推荐(0) 编辑
摘要: 1 全局变量(extern)当两个类都需要使用共同的变量,我们将这些变量定义为全局变量。比如,res.h和res.cpp分别来声明和定义全局变量,类ProducerThread和ConsumerThread来使用全局变量。/**********res.h声明全局变量*... 阅读全文
posted @ 2016-03-15 09:59 牧羊少年10号 阅读(856) 评论(0) 推荐(0) 编辑
摘要: 菜鸟经常将编译器和解释器弄混淆,无奈之下,于是向高手请教。 高手说:“ 解释器是一条一条的解释执行源语言。比如php,postscritp,javascript就是典型的解释性语言。 编译器是把源代码整个编译成目标代码,执行时不在需要编译器,直接在支持目标代... 阅读全文
posted @ 2016-03-13 23:47 牧羊少年10号 阅读(175) 评论(0) 推荐(0) 编辑
摘要: 一个由C/C++编译的程序占用的内存分为以下几个部分1、栈区(stack)— 由编译器自动分配释放 ,存放函数的参数名,局部变量的名等。其操作方式类似于数据结构中的栈。2、堆区(heap)— 由程序员分配释放, 若程序员不释放,程序结束时可能由OS回收。注意它与数据结... 阅读全文
posted @ 2016-03-13 23:36 牧羊少年10号 阅读(140) 评论(0) 推荐(0) 编辑
摘要: #include #include #include using namespace std;typedef struct tagSNode{ int value; tagSNode* pNext; tagSNode(int x) :value(x), pNext(N... 阅读全文
posted @ 2016-03-13 21:17 牧羊少年10号 阅读(114) 评论(0) 推荐(0) 编辑
摘要: #include #include #include using namespace std;typedef struct tagSNode{ int value; tagSNode* pNext; tagSNode(int x) :value(x), pNext(N... 阅读全文
posted @ 2016-03-13 14:44 牧羊少年10号 阅读(107) 评论(0) 推荐(0) 编辑
摘要: #include #include #include using namespace std;vector GetPrimeNumber(const int N){ vector b; int* a = new int[N+1]; a[1] = false; for ... 阅读全文
posted @ 2016-03-13 13:47 牧羊少年10号 阅读(84) 评论(0) 推荐(0) 编辑
摘要: #include #include #include using namespace std;int main(){ vector a(10); int b[10]; int *c = new int[10]; char str2[10]; char *str3 =... 阅读全文
posted @ 2016-03-13 13:24 牧羊少年10号 阅读(539) 评论(0) 推荐(0) 编辑
摘要: 走近腾讯 走进腾讯 ――谨以此文献给所有找工的战友前言 本人是03计A一学生,一个普通的潮州男生。我热爱我的专业,热爱软件开发,喜欢开发给... 阅读全文
posted @ 2016-03-11 22:42 牧羊少年10号 阅读(254) 评论(0) 推荐(0) 编辑
上一页 1 ··· 5 6 7 8 9 10 11 下一页