02 2008 档案

2008年2月编程语言排名

posted @ 2008-02-19 10:30 浴盆 阅读(2929) | 评论 (7) 编辑

C++中关于sizeof的相关应用
摘要: #include<iostream>usingnamespacestd;intmain(){intarry[3]={1};cout<<"sizeof(array)"<<"="<<sizeof(arry)<<endl;cout<<"sizeof(arry[0])"<<"="<<sizeof(arry[0]...阅读全文

posted @ 2008-02-07 16:12 浴盆 阅读(226) | 评论 (3) 编辑

用泛型实现在数组模拟入栈出栈时多类型的使用
摘要: /**//**CreatedbySharpDevelop.*User:??*Date:2008-2-3*Time:9:14**??????*/usingSystem;classStatck<T>{privateT[]statck;privateintcount;publicStatck(intsize){statck=newT[size];count=0;}publicvoidPush...阅读全文

posted @ 2008-02-03 10:54 浴盆 阅读(211) | 评论 (2) 编辑

C++中几种不同交换两个数的方法
摘要: #include<iostream>usingnamespacestd;voidswapr(int&a,int&b);voidswapp(int*a,int*b);voidswapv(inta,intb);intmain(){inta,b;cout<<"请输入a"<<endl;cin>>a;cout<<"请输入b"<...阅读全文

posted @ 2008-02-01 13:22 浴盆 阅读(690) | 评论 (0) 编辑

C++中引用变量的用例
摘要: #include<iostream>usingnamespacestd;intmain(){inti=1;int&x=i;//对变量I的引用cout<<"i="<<i<<""<<"address="<<&i<<endl;cout<<"x="<<x<<""<&...阅读全文

posted @ 2008-02-01 12:54 浴盆 阅读(261) | 评论 (0) 编辑

关于strlen/sizeof函数在char和string类型中的应用
摘要: #include<iostream>usingnamespacestd;intmain(){//typedefstructstudent//{//charname[10];//charsex;//longsno;//floatscore[4];//}STU;////STUa[5];////cout<<sizeof(a)<<endl;////return0;cha...阅读全文

posted @ 2008-02-01 10:01 浴盆 阅读(737) | 评论 (0) 编辑