(2)字符串除了用C++扩充的string类型外,按C语言的传统,还可以用char *表示。请将类声明中的string全部改为char *后,重新写一遍程序(此时的区别是,类中有指针成员,构造和析构函数需要考虑深复制的问题了。)
class CPerson
{
protected:
char *m_szName;
char *m_szId;
int m_nSex...
分类:
其他好文 时间:
2015-05-20 09:46:30
阅读次数:
166
malloc
头文件: stdlib.h 或者 malloc.h
memset
头文件: string.h 或memory.h
printf
头文件: stdio.h...
分类:
其他好文 时间:
2015-05-20 09:42:40
阅读次数:
123
public static void openURL(String url) { try { browse(url); } catch (Exception e) { JOptionPane.showMessageDialog(...
分类:
编程语言 时间:
2015-05-20 09:26:54
阅读次数:
118
word分词提供了两种文本相似度计算方式: 方式一:余弦相似度,通过计算两个向量的夹角余弦值来评估他们的相似度 实现类:org.apdplat.word.analysis.CosineTextSimilarity 用法如下: String?text1?=?"我爱学...
分类:
其他好文 时间:
2015-05-20 08:20:25
阅读次数:
109
jQuery.extend({ parseJSON: function (data) { if (typeof data !== "string" || !data) { return null; } // Make sure leading/trailing whitespace is remov...
分类:
Web程序 时间:
2015-05-20 08:15:37
阅读次数:
184
Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters for "abcabcbb" is "abc", which the length is 3. F...
分类:
其他好文 时间:
2015-05-20 02:18:57
阅读次数:
100
str=$1
f()
{
echo"#include<stdio.h>">$str
echo"#include<stdlib.h>">>$str
echo"#include<string.h>">>$str
echo"#include<unistd.h>">>$str
echo"#include<ctype.h>">>$str
echo"#include<stdlib.h>">&..
分类:
其他好文 时间:
2015-05-20 02:16:19
阅读次数:
145
PHP中redis的使用redis是一个key-value存储系统。和Memcached类似,它支持存储的value类型相对更多,包括string(字符串)、list(链表)、set(集合)和zset(有序集合)。这些数据类型都支持push/pop、add/remove及取交集并集和差集及更丰富的操...
分类:
Web程序 时间:
2015-05-20 02:06:59
阅读次数:
146
Given a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively.Below is one possible representatio...
分类:
编程语言 时间:
2015-05-20 01:57:32
阅读次数:
192
// 构造json对象
String resStr1 = "{" + "name:" + "\"zhangsan\"," + "id:" + "\"id001\"" + "}";
String resStr2 = "{" + "name:" + "\"lisi\"," + "id:" + "\"id002\"" + "}";
String resStr3 = "{" + "name:" + "\"wangwu\"," + "id:" + "\"id003\"" + "}";
// 构造json数组
S...
分类:
编程语言 时间:
2015-05-20 00:37:09
阅读次数:
157