摘要:
boolcheck(char*str){if(str==NULL)returntrue;intlen=strlen(str);if(len==0)returntrue;mapplace;inti=0;for(i=0;i(str[i],true));elsereturnfalse;}returntru... 阅读全文
摘要:
http://www.importnew.com/7553.htmlfinal Integet len = 10;len = 100;这样编译通不过,因为final指向的对象修改,但是final变量不可以指向新的对象,这里的赋值操作,就是指向了新对象。final Test test = new Te... 阅读全文
摘要:
java中统一使用unicode编码,所以每个字符都是2个字节16位。unicode包括中文,所以对String类计算长度的时候,一个中文和一个英文都是一个长度。String voice = "好声音"; System.out.println(voice.length());输出的是3但是在C语言中... 阅读全文
摘要:
关于内存分配的文章走进C++程序世界-----指针(动态申请空间和释放空间)http://blog.csdn.net/sjin_1314/article/details/11675591 阅读全文
摘要:
int a[][4];int *a[4];int ** a;int (*a)[4];注意这四种情况,搞懂这四种情况,就基本没问题了。转自:http://www.cnblogs.com/chenbin7/archive/2011/10/03/2198675.html#includeusingnames... 阅读全文
摘要:
delete以后使用 p = NULL 阅读全文
摘要:
void func(int value);这样的函数,不可以这样子使用:const int value =100;func(value );因为func里面可能会对value进行更改,将const类型传入,里面的代码可能无法运行。 阅读全文
摘要:
structvp{intvalue;intplace;};boolcomp(conststructvpa,conststructvpb){returna.valuetwoSum(vector&numbers,inttarget){vectorv;for(inti=0;itarget){break... 阅读全文
摘要:
自己写的比较差的,时间过不去#include#include#include#include#include#include#include#include#includeusingnamespacestd;stringato_string(intvalue){stringstreamss;ssv)... 阅读全文
摘要:
#include#include#include#include#include#include#includeusingnamespacestd;intevalRPN(vector&tokens){stackvalue;inti=0;for(i=0;is;s.push_back("4");s.pu... 阅读全文