上一页 1 2 3 4 5 6 7 8 9 ··· 11 下一页
摘要: 需要注意的问题有几点: 1、遍历所有元素节点的方式是:document.getElementsByTagName("*"),同时为了兼容性好可以再一句:document.all 2、节点的宽高怎么获得? 可以使用ele.style.width(返回值为字符串,需要使用parseFloat函数转换,元素的width必须明确指定,否则返回NaN),也可以使用ele.offsetWidth(... 阅读全文
posted @ 2015-09-05 20:00 WQZ321123 阅读(571) 评论(0) 推荐(0) 编辑
摘要: 实现检测数组重复元素的功能,需要注意一点的是,多个(2个或2个以上)重复元素,我们只需要挑出一个来就可以了。 文字循环显示 截图结果: 阅读全文
posted @ 2015-09-03 22:15 WQZ321123 阅读(2871) 评论(0) 推荐(0) 编辑
摘要: 1、什么是虚函数? 在类中使用virtual关键字声明的函数就叫虚函数。 2、为什么使用虚函数? 因为使用虚函数以后,集成类可以重载基类中的虚成员函数。 3、析构函数可以定义成虚函数吗? 可以,虚析构函数是允许的,但是要注意,只有在作为基类时,我们才需要将析构函数写成虚函数。 4、虚拟机制与构造函数 在类的构造函数中,虚拟机制不会发生作用。因为,基类的构造函数在派生类构造函数之前执行... 阅读全文
posted @ 2015-09-01 17:07 WQZ321123 阅读(165) 评论(0) 推荐(0) 编辑
摘要: class A { ... private: int &a; }; class B : public A { ... private: int a; public: const int b; A c; static const char* d; A* e; }; 答案是 b c 构造函数初始化时必须采用初始化列表一共有三种... 阅读全文
posted @ 2015-08-31 22:53 WQZ321123 阅读(628) 评论(0) 推荐(0) 编辑
摘要: 常量字符数组与常量字符串: const char str1[] = "abc"; const char str2[] = "abc"; const char *p1 = "abc"; const char *p2 = "abc"; printf("%d %d %d %d\n",str1, str2,p1,p2); 结果是什么? ... 阅读全文
posted @ 2015-08-31 22:47 WQZ321123 阅读(209) 评论(0) 推荐(0) 编辑
摘要: 题目来源http://www.nowcoder.com/questionTerminal/7fb8ba37f48c4feaaf518f221caefcb4 中缀表达式(a+b)*c*(d-e/f) 转成后缀 是? 其实呢,看了一下解释,这里所谓的前缀、中缀和后缀表达式就和二叉树里的前序、中序、后序遍历差不多、意思是一个意思。 对于这种题,我们可以画出一颗适合题目的二叉树来,进而求... 阅读全文
posted @ 2015-08-31 19:30 WQZ321123 阅读(192) 评论(0) 推荐(0) 编辑
摘要: 比如:0011000111 则表示0最大出现3次,1最大出现3次。 程序的思路很巧妙,不复杂。 // demo.cpp : 定义控制台应用程序的入口点。 // #include "stdafx.h" #include using namespace std; static void strwe(char *str) { int len=0; while(*st... 阅读全文
posted @ 2015-08-31 16:22 WQZ321123 阅读(673) 评论(0) 推荐(0) 编辑
摘要: 首先,上一段代码: var f = function g() { return 23; }; console.log(typeof g); //输出undefined //console.log(typeof g()); ... 阅读全文
posted @ 2015-08-30 22:09 WQZ321123 阅读(802) 评论(0) 推荐(0) 编辑
摘要: 首先,上一段代码 static bool reverse_str(const char *str) { const char *temp=str; while(*temp++); temp-=2; //指针返回到字符串的末尾 while(str<temp) { if (*str!=*temp) { ... 阅读全文
posted @ 2015-08-29 23:02 WQZ321123 阅读(659) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://wenku.baidu.com/link?url=7Gbarr5q9X6h1QFRVAsHmfPp1xXagG209mvrJqBogseb4WLeRqbVKwxQieoh8SL0-BDawlYXYr4vY1TSxgxNtTJ2kRDGust7XVFSiKDbBZC 一、实时刷新(1秒)的时钟 需要注意的地方: JavaScript代码放置的位置问题,如果放在body元... 阅读全文
posted @ 2015-08-28 16:54 WQZ321123 阅读(1926) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 ··· 11 下一页