当类中用到一些固定值时,希望将其定义为const成员变量,防止被修改。但因为const成员变量因为初始化之后就不能修改,因此只能在构造函数的初始化列表中初始化如果是数组,则没有办法在初始化列表中初始化,必须定义为static,放在类外定义例子://const_array.h#include
usin...
分类:
其他好文 时间:
2014-05-12 12:16:52
阅读次数:
228
对列表进行排序一般都由后台来完成,但如果列表项不多无需分布的话也可以用JS完成,要使用JS排序自然也就想到sort()方法和reverse()方法,这两函数在JS中使用得比较多大家也许比较熟悉,但对于刚接触这两函数的初学者还是需要注意几点。sort()
方法用于对数组的元素进行正序排列reverse...
分类:
Web程序 时间:
2014-05-10 08:12:32
阅读次数:
421
获取插入的id:mysql_insert_idfetch_row转换成数组这个有0123下标的
fetxh_array转换不仅有数字下标还有字段名mysql_close($conn)关闭数据库连接
分类:
其他好文 时间:
2014-05-10 06:48:23
阅读次数:
230
javascript版in_array函数,用于判断数组中是否存在特定值。判断一个字符串或者数字是否在数组内,很多程序语言都有这样一样专门的函数,比如PHP的in_array()。那么JS有木有呢,很遗憾,JS木有这样的函数,于是想到伟大的JQ是否封装了这个函数,找到了API,JQ的确封装了这个函数...
分类:
编程语言 时间:
2014-05-10 06:10:51
阅读次数:
360
原题地址:http://www.cnblogs.com/x1957/p/3373994.html题意:Given
an array of integers, every element appearstwiceexcept for one. Find that single
one.要求:线性时间复...
分类:
编程语言 时间:
2014-05-10 05:22:27
阅读次数:
408
//#include
#include
#include
//using namespace std;
//const int MAXN=10;
//int Stack[MAXN];
stack s;
class Solution {
public:
int getNumber(int x)
{
//int lengthOfStack=0;...
分类:
其他好文 时间:
2014-05-10 04:45:29
阅读次数:
231
AJAX的知识: 1:mysql_fetch_row与mysql_fetch_array的区别
mysql_fetch_row:从结果集中取得一行作为关联数组(转换成0,1,2,3小标就是数组有下标)
mysql_fetch_array:从结果集中取得一行作为关联数组,或数字数组,或二者兼...
分类:
其他好文 时间:
2014-05-10 03:15:14
阅读次数:
299
Jump Game Given an array of non-negative
integers, you are initially positioned at the first index of the array. Each
element in the array represents ...
分类:
其他好文 时间:
2014-05-10 03:13:50
阅读次数:
481
原题地址:http://oj.leetcode.com/problems/single-number-ii/题意:Given
an array of integers, every element appearsthreetimes except for one. Find that
single ...
分类:
编程语言 时间:
2014-05-10 03:01:41
阅读次数:
413
Array.prototype.slice.call(document.links,0).forEach(function(link){link.onmousedown
= null})插件总失效 用这个对付下
分类:
其他好文 时间:
2014-05-10 00:15:19
阅读次数:
250