API提供了很多方法供程序开发员使用,接下来两篇将和大家分享两个常用的数组操作方法,今天来介绍第一种方法——数组的拷贝操作。范例:TestJava4_4.java01 // 以下这段程序说明数组的拷贝操作02 public class TestJava4_403 {04 public stat...
分类:
编程语言 时间:
2014-08-15 19:36:49
阅读次数:
209
likely和unlikey函数源码分析
看代码的时候常常遇到likely和unlikely这两个函数,大概知道是用来检测返回值的,但是也不知道是什么。今天实在不爽了,就去看源码了。
在内核代码树的 include/linux/compiler.h里
void ftrace_likely_update(struct ftrace_branch_...
分类:
其他好文 时间:
2014-08-15 17:57:29
阅读次数:
233
a storage class can only be specified for objects and functionsextern修饰一个struct报错,错误原因如上,C++中存储类修饰符有auto、register、extern、static,这几种修饰符只能修饰对象或者函数,这里用ex...
分类:
系统相关 时间:
2014-08-15 17:27:59
阅读次数:
230
#include
#include
#include
using namespace std;
struct Data
{
void assign(int x,int y,int z)
{
row=x;
col=y;
val=z;
}
int row,col,val;
} data[730];
struct Node
...
分类:
其他好文 时间:
2014-08-15 16:02:29
阅读次数:
1129
一个简单的三维BFS:
刚开始说内存超出了,就把 标记走过的路语句 和 判断到达终点的语句 放在了push(next)之前
#include
#include
#include
#include
#define N 51
using namespace std;
struct node{
int x,y,z;
int t;
};
int dir[8]...
分类:
其他好文 时间:
2014-08-15 14:45:28
阅读次数:
292
#include#include#include#includeusing namespace std;struct p{int a,b;};bool cmp(p p1, p p2){if(p1.b>p2.b) return true;if(p1.b==p2.b && p1.a>m;while(m-...
分类:
其他好文 时间:
2014-08-15 12:47:48
阅读次数:
281
struct bitmap{ unsigned int len; unsigned char* buf;};struct bitmap* creat_bitmap(unsigned int len){ struct bitmap *bm; if (len buf = ...
分类:
其他好文 时间:
2014-08-15 12:46:48
阅读次数:
213
#include using namespace std;struct node{ int l,w;}dp[1005];int g[1005][1005];int d[1005];int k,max_v;int f(int i){ if (d[i]>0) return d[i]; d[i]=1; f...
分类:
其他好文 时间:
2014-08-15 12:33:58
阅读次数:
197
为了方便使用,我做了如下结构体的嵌套使用:struct operation{ int num; char name[100]; char owner[100]; char msg[100];};struct collect{ int num; char name[100]; char owner[1...
分类:
其他好文 时间:
2014-08-15 12:03:28
阅读次数:
308
1: 类Class:typedef structobjc_class * Class;从Class的定义可以看出,它是一个 objc_class 结构类型的指针,objc_class又是什么呢?struct objc_class{ struct objc_class* isa; stru...
分类:
其他好文 时间:
2014-08-15 12:01:38
阅读次数:
208