易截截图软件、单文件、免安装、纯绿色、仅160KB

C字符串操作函数源码

 
#ifndef _PPC_BOOT_STRING_H_
#define _PPC_BOOT_STRING_H_
#include <stddef.h>
extern char *strcpy(char *dest, const char *src);
extern char *strncpy(char *dest, const char *src, size_t n);
extern char *strcat(char *dest, const char *src);
extern int strcmp(const char *s1, const char *s2);
extern size_t strlen(const char *s);
extern size_t strnlen(const char *s, size_t count);
extern void *memset(void *s, int c, size_t n);
extern void *memmove(void *dest, const void *src, unsigned long n);
extern void *memcpy(void *dest, const void *src, unsigned long n);
extern int memcmp(const void *s1, const void *s2, size_t n);
#endif    /* _PPC_BOOT_STRING_H_ */
------------------------------
/*
*  linux/lib/string.c
*
*  Copyright (C) 1991, 1992  Linus Torvalds
*/
/*
* stupid library routines.. The optimized versions should generally be found
* as inline code in <asm-xx/string.h>
*
* These are buggy as well..
*
* * Fri Jun 25 1999, Ingo Oeser <ioe@informatik.tu-chemnitz.de>
* -  Added strsep() which will replace strtok() soon (because strsep() is
*    reentrant and should be faster). Use only strsep() in new code, please.
*
* * Sat Feb 09 2002, Jason Thomas <jason@topic.com.au>,
*                    Matthew Hawkins <matt@mh.dropbear.id.au>
* -  Kissed strtok() goodbye
*/
#include <linux/types.h>
#include <linux/string.h>
#include <linux/ctype.h>
#include <linux/module.h>
#ifndef __HAVE_ARCH_STRNICMP
/**
* strnicmp - Case insensitive, length-limited string comparison
* @s1: One string
* @s2: The other string
* @len: the maximum number of characters to compare
*/
int strnicmp(const char *s1, const char *s2, size_t len)
{
/* Yes, Virginia, it had better be unsigned */
unsigned char c1, c2;
c1 = c2


相关文档:

C/C++问答(3):关于构造和析构函数使用多态

问:
在构造或析构期间能使用虚函数吗?
答:
能,但最好不要这么做。
前两天在公司游戏项目开发过程中,在析构函数中不小心调用了虚函数,而且还是个纯虚函数。
因为一直是在Rlease模式下工作的,导致系统直接终止客户端,虽然控制台有打印这个错误,但终止太快,也没看到。切换在Debug下调试,则会报R6025 -pure vir ......

curl c api

 curl c api
关于Curl的介绍很多,这里不详细介绍,主要谈一下简单应用。
最近研究了一下Linux下的curl C API,curl c API的文档比较丰富,唯一就是查找起来,费些时间。Curl的C API和curl的PHP API,函数接口和作用大致相同,所以如果有PHP API使用经验应该很好理解。
1:CURLcode curl_global_init(long flags);函 ......

C/C++——小编谈C语言函数那些事(7)

C程序是由一组或是变量或是函数的外部对象组成的。 函数是一个自我包含的完成一定相关功能的执行代码段。下面小编和大家分享下C语言中的函数。
1.       fgetc函数
fgetc函数的功能是从流中读取字符,其用法是:int fgetc(FILE *stream); 程序例子如下:
#include <string.h ......

C和C++混合编程(__cplusplus使用)


第一种理解
比如说你用C++开发了一个DLL库,为了能够让C语言也能够调用你的DLL输出(Export)的函数,你需要用extern "C"来强制编译器不要修改你的
函数名。
通常,在C语言的头文件中经常可以看到类似下面这种形式的代码:
#ifdef __cplusplus
extern "C" {
#endif
/**** some declaration or so *****/
#ifde ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号