发现C++里有个很好玩的 函数 string(),头文件必须是,不能是 ,下面因为memset(),所以我又定义了,string()可以直接定义 字符串,但是需要C++强大的输入流,scanf无法使用, 字符串长度 a.lenth();挺棒的,想从C 转型到C++了,以后打代码,尽量使用C++;
#include
#include
#include
#include
#include...
分类:
其他好文 时间:
2014-05-25 18:23:26
阅读次数:
234
(1)String构建的对象不能改变,每次对String进行操作时,如两个String相加,需要新建一个String对象,然后容纳最终的结果。
而StringBuilder与StringBuffer构建的对象可以随时在修改其内容,而无需生成新的对象。一般新建一个对象是会生成16个字节的空间,之后根据需要再增加空间。
由于一般新构建一个对象涉及分配内存空间分配、无引用对象过多时的垃圾回收等,因此,对于操作频繁的字符串需使用StringBuilder或StringBuffer...
分类:
其他好文 时间:
2014-05-25 18:17:57
阅读次数:
225
using recursive and bitwise methods to get
string combinations.
分类:
其他好文 时间:
2014-05-25 12:26:56
阅读次数:
187
Windows开机自启动的程序很多,包括系统软件、杀毒软件、一些其他安装软件等等。当然可以禁止,通过软件管理或者手动删除对应的注册表中的项即可!但是为了系统的服务或者操作上的方便,我们往往需要开机自启动一些服务。
以下是开机的启动项: Qt也不例外,在发布Qt程序的时候,我们通常也需要...
分类:
其他好文 时间:
2014-05-25 12:25:53
阅读次数:
194
http://www.2cto.com/kf/201203/122910.htmlAndroid
SDK中有这样一个API:public abstract Intent getLaunchIntentForPackage (String
packageName)如果packageName存在返回入口...
分类:
移动开发 时间:
2014-05-25 11:46:36
阅读次数:
239
链接这个题把病毒分为了两种,一种包含可以覆盖,另一种不可以,需要分别求出包含他们的个数,可以把两种都建在一颗tire树上,在最后求得时候判断一下当前节点是属于哪种字符串,如果是不包含的需要判断一下pre[i]+len[i]
2 #include 3 #include 4 #include 5...
分类:
其他好文 时间:
2014-05-25 11:45:36
阅读次数:
263
官方给的说明:
public void addJavascriptInterface (Object object, String name)
Added in API level 1
Injects the supplied Java object into this WebView. The object is injected into the JavaScript...
分类:
移动开发 时间:
2014-05-25 09:02:35
阅读次数:
520
常用android的smali注入代码
1.增加log信息
const-string v3,"SN"
invoke-static {v3,v0}, Landroid/util/Log;->v(Ljava/lang/String;Ljava/lang/String;)I
2.弹出消息框
new AlertDialog.Builder(self)
.setTitl...
分类:
移动开发 时间:
2014-05-25 09:00:41
阅读次数:
324
数据同步对比步骤:1.将两数据库中对应的数据表分别生成XML文件 /// ///
将一个DataTable以xml方式存入指定的文件中 /// /// /// public void SaveDataTableToXml(DataTable
dt, string filePath)...
分类:
其他好文 时间:
2014-05-25 07:45:19
阅读次数:
199
【题目】
Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return the length of last word in the string.
If the last word does not exist, return 0.
Note: A word is defined as a character sequence consists of non-space ...
分类:
其他好文 时间:
2014-05-25 07:39:05
阅读次数:
256