1.前导程序#include#include //1提供strlen()的函数原型#define DENSITY 62.4 //2预处理命令int main(void){ float weight,volume; int size,letters; char...
分类:
其他好文 时间:
2014-11-08 13:20:10
阅读次数:
324
#include
#include
#if 0
// 默认使用法4
// 法1
int strlen(const char* str)
{
int n;
// const char *p = str; //测试这句,这个语句不需要,因为我实参是指针,形参指针改变指向不影响实参指向
for(n = 0; *str != '\0'; n++)
{
str++;
}
return...
分类:
编程语言 时间:
2014-11-08 00:56:24
阅读次数:
307
#pragma mark- MD5加密- (NSString *)md5:(NSString *)str{ const char *cStr = [str UTF8String]; unsigned char result[16]; CC_MD5(cStr, strlen(cStr), result...
分类:
其他好文 时间:
2014-11-07 16:41:18
阅读次数:
202
//导入这个就行了#import //没有导包的时候,提示如下:Implicit declaration of function 'CC_MD5' is invalid in C99CC_MD5( cStr, strlen(cStr),result);
分类:
其他好文 时间:
2014-11-07 12:57:38
阅读次数:
179
在PHP中,strlen与mb_strlen是求字符串长度的函数,但是对于一些初学者来说,如果不看手册,也许不太清楚其中的区别。 下面通过例子,讲解这两者之间的区别。 先看例子: <?php??//测试时文件的编码方式要是UTF...
分类:
其他好文 时间:
2014-11-07 09:58:49
阅读次数:
203
strlen与sizeof的区别1.sizeof操作符的结果类型是size_t,它在头文件中typedef为unsigned int类型。 该类型保证能容纳实现所建立的最大对象的字节大小。2.sizeof是算符,strlen是函数。3.sizeof可以用类型做参数,strlen只能用char*做参数...
分类:
其他好文 时间:
2014-11-07 06:08:03
阅读次数:
284
1.rand是官方函数,mt_rand的是非官方的,mt_rand的效率和速度比rand要高的多 2.substr与mb_substr关系,strlen与mb_strlen:substr是按照字符来截取字符串的,mb_substr是按照字符编码来截取的,同理strlen与mb_st...
分类:
Web程序 时间:
2014-11-05 23:22:37
阅读次数:
387
题意:二进制指令转汇编指令,汇编指令转二进制指令。思路:额,条理分好,想全,思维不能乱。代码:int findyu(char yu[50],char c){ int l=strlen(yu); rep(i,0,l-1) if(c==yu[i]) return i;}int calc(ch...
分类:
其他好文 时间:
2014-11-05 22:51:37
阅读次数:
201
#include<stdio.h>
#include<string.h>
intmain(intargc,constchar*argv[]){
charone[100],two[100],sum[100];
inttemp=0,lenth,lenthTwo,i,lenthOfSum;
scanf("%s",one);
getchar();//读取回车字符
scanf("%s",two);
lenthTwo=(int)strlen(two);
if(strlen(t..
分类:
编程语言 时间:
2014-11-05 15:02:57
阅读次数:
200
#include #include #include using namespace std;char line[82];char space[82];int main() { scanf("%s", line); int len = strlen(line); int side_...
分类:
其他好文 时间:
2014-11-02 21:00:48
阅读次数:
177