类模板:template struct pair参数:T1是第一个值的数据类型,T2是第二个值的数据类型。功能:pair将一对值组合成一个值,这一对值可以具有不同的数据类型(T1和T2),两个值可以分别用pair的两个公有函数first和second访问。具体用法:1.定义(构造):pair p1....
分类:
编程语言 时间:
2014-07-14 00:41:51
阅读次数:
189
定义一个结构体,有两个成员变量,一个整型的n,一个字符型的c,利用结构体类型声明一个具有5个元素的数组,并随机初始化,根据成员变量n进行从小到大排序,然后输出 冒泡排序然后 在输出结构体#includestruct d{int x;char y;};int main(void){struct d a...
分类:
编程语言 时间:
2014-07-13 23:50:55
阅读次数:
410
STL源码之vector1. SGI的vectorSGI stl vector继承子一个基类:template > class vector : protected _Vector_base在基类中定义了基本的一些操作,并且封装了了vector所需要的基本的三个指针:struct _Vector_....
分类:
其他好文 时间:
2014-07-13 23:19:35
阅读次数:
188
package cn.itcast.day1;public class Enum { public static void main(String[] args) { Weekday1 weekday = Weekday1.SAT; System.out.println(weekday.ne...
分类:
其他好文 时间:
2014-07-13 23:16:22
阅读次数:
349
字典树查询
#include
#include
#include
using namespace std;
const int maxn = 30;
typedef struct Trie{
int v;
Trie *next[ maxn ];
}Trie;
Trie root;
void CreateTrie( char *str ){
int len = strlen( st...
分类:
其他好文 时间:
2014-07-13 17:17:39
阅读次数:
336
关于有继承modelDriven接口的action的ajax调用传入参数...
分类:
其他好文 时间:
2014-07-13 16:28:44
阅读次数:
156
ajax 如何使用不同namespace的action...
分类:
其他好文 时间:
2014-07-13 16:23:32
阅读次数:
111
DOWN操作:linux内核中,对信号量的DOWN操作有如下几种:
void down(struct semaphore *sem); //不可中断
int down_interruptible(struct semaphore *sem);//可中断
int down_killable(struct semaphore *sem);//睡眠的进程可以因为受到致命信号而被唤醒,中断获取信号量...
分类:
其他好文 时间:
2014-07-13 16:21:36
阅读次数:
501
比如在插入有序链表的过程中,一般情况下要使用俩指针来遍历,而后还要判断是否在第一个位置插入;利用指针的指针后不需要另外考虑这种特殊情况。
代码:
#include
#include
struct node{
int data;
struct node *next;
} *head;
//sorted link-list
void insert(struct no...
分类:
其他好文 时间:
2014-07-13 15:38:13
阅读次数:
198
1.在搜索匹配时注意大小写问题
2.别为了解决旧问题而产生新问题。
3.使用enum的好处:使用enum的方法或类会受到它的保护,不会有未定义的enum的值。因此不会有打错字或拼错字,对任何具有标准范围或合法值的东西都能避免取得坏数据。...
分类:
其他好文 时间:
2014-07-12 18:31:55
阅读次数:
225