#include "stdafx.h"
#include #include using namespace std; char *delete_chars(char *str,int pos,int len)
{ char *p=str+pos-1; int tt=strlen(str); if (...
分类:
其他好文 时间:
2015-04-20 22:25:23
阅读次数:
231
void get_next(char *s){ int len = strlen(s); int j = 0; int k = -1; while (j #include #include #include #include #include #include #include #...
分类:
其他好文 时间:
2015-04-20 22:19:25
阅读次数:
359
在php中常见的计算字符串长度的函数有:strlen和mb_strlen,下面是对这两个函数的比较说明(编码方式UTF8)
比较strlen和mb_strlen
当字符全是英文字符的时候,两者是一样。这里主要比较一下,中英文混排的时候,两个计算结果。(测试时编码方式是UTF8)
<?php
$str=‘中文a字1符‘;
echo strlen($str);
echo ‘‘;
...
分类:
Web程序 时间:
2015-04-20 11:19:03
阅读次数:
119
1.sizeof和strlen的区别 1)sizeof操作符的结果类型是size_t,它在头文件中的typedef为unsigned int 类型。该类型保证能容纳实现所在建立的最大对象的字节大小 2)sizeof 是操作符,strlen是函数 3)sizeof是可以用类型做参数,strlen...
分类:
编程语言 时间:
2015-04-20 01:48:42
阅读次数:
138
简单的二叉搜索树建树过程#include#includeint tree1[1500], tree2[1500];char s[1000], k[1000];void build1(){ int i; tree1[1] = s[0] - '0'; int y = strlen(s)...
分类:
其他好文 时间:
2015-04-19 10:06:43
阅读次数:
119
/*创建取拼音首字母函数*/ create function [dbo].[fn_ChineseToSpell](@strChinese varchar(500)='') returns varchar(500) as begin /*函数实现开始*/ declare @strLen int,@r....
分类:
数据库 时间:
2015-04-18 17:35:02
阅读次数:
205
1 #include 2 #include 3 const int Len = 100; 4 void Mul(char a[],char b[],char c[])//大数乘法 5 { 6 int i,j; 7 int alen = strlen(a),blen = strlen...
分类:
其他好文 时间:
2015-04-17 23:35:54
阅读次数:
225
题目大意:求出两个串的公共子序列的长度
LCS的入门题,读懂题了直接模板就可以
#include
#include
using namespace std;
const int N=1000;
int a[N][N];
int LCS(const char *s1, const char *s2)
{// s1:0...m, s2:0...n
int m = strlen(s...
分类:
其他好文 时间:
2015-04-17 22:21:07
阅读次数:
206
一、开启socketphpinfo();查看是否开启了socket扩展,否则在php.ini中开启。二、服务器端代码的写法server send:welcome"; socket_write($msgsock, $msg, strlen($msg)); echo 'read client messa...
分类:
Web程序 时间:
2015-04-16 23:15:18
阅读次数:
171
(1)阅读下面的程序,补足未完成的注释
#include
#include
using namespace std;
class A
{
private:
char *a;
public:
A(char *aa)
{
a = new char[strlen(aa)+1]; //(a)这样处理的意义在于:开辟一个新的空间用来存储数据
str...
分类:
其他好文 时间:
2015-04-16 19:53:26
阅读次数:
112