1. 可变参数等同于数组参数public void add(int[] ints) {}public
void add(int...intt) {}以上代码是无法通过编译的。2.
向上兼容可变参数是JDK5的一个新特性,在此之前是通过数组来满足需求的。所以可变参数可以接受一个相同类型的数组,但是数组...
分类:
编程语言 时间:
2014-07-22 23:17:14
阅读次数:
422
【转载】http://blog.sina.com.cn/s/blog_638dd78201018663.html函数原型:int
GetDeviceCaps(int nIndex);常用的参数有(参考MSDN):int
iHORZSIZE=pDC->GetDeviceCaps(HORZSIZE); ...
分类:
其他好文 时间:
2014-07-22 23:16:52
阅读次数:
347
一、类型初窥:掀起你的盖头来
(1)C程序是一组函数和数据类型,C++程序是一组函数和类,而C#程序是一组类型声明;
(2)类型是一种模板:模板本身不是数据结构,但它详细说明了由该模板构造的对象的特征;
(3)C#提供了16种预定义类型:13种简单类型(数值类型:int,float,doubl...
分类:
其他好文 时间:
2014-07-22 23:16:35
阅读次数:
364
疑问void max(const int x, const int y);void
max(int x, int
y);为什么报错:重复声明解释“这种差异并不影响传递至函数的对象...其原因在于实参传递的方式。复制形参时并不考虑形参是否为const---函数操纵的只是副本。函数无法修改实参...这两...
分类:
其他好文 时间:
2014-07-22 23:16:32
阅读次数:
297
字符串替换, src 源字符串, buf_size 缓冲大小, search搜索的字符串大小,
repstr 需要替换成的字符串int str_replace(char *src, unsigned int buf_size, char* search,
char *repstr){ if(!src...
分类:
其他好文 时间:
2014-07-22 23:15:37
阅读次数:
380
http://www.cnblogs.com/hazir/p/new_and_delete.htmlint *p=new(10);创建空间,指向10,int*
p=new[10];创建数组空间
分类:
其他好文 时间:
2014-07-22 23:14:55
阅读次数:
248
#include#includeusing namespace std;#define maxn
200005class Node{public: int l,r; int add;//附加值 int sum;}node[maxn];int
getRight(int n){//获得...
分类:
其他好文 时间:
2014-07-22 23:14:14
阅读次数:
431
#include #include using namespace std;int
s[4],p[4];long long llmax(long long a,long long b){ return a>b?a:b;}int
main(){ int t; cin>>t; int c=1; whil...
分类:
其他好文 时间:
2014-07-22 23:13:54
阅读次数:
307
//华为编程:筷子,找到第一个单对的筷子#include #define max 37int
main(){ int n,i,j; int a[max]; int flag=0; int error=-1; scanf("%d",&n);
if(n>max) ...
分类:
其他好文 时间:
2014-07-22 23:13:33
阅读次数:
339
/************ PID算法(C语言) ************/ #include
#include struct _pid { int pv; /*integer that contains the process value*/ int
sp; /*integ...
分类:
编程语言 时间:
2014-07-22 23:12:56
阅读次数:
447