Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

C×Ö·û´®´¦Àíº¯ÊýµÄʵÏÖ

C×Ö·û´®´¦Àíº¯ÊýµÄʵÏÖ£¨Linux£©
#include <stddef.h>
char * ___strtok = NULL;
char * strcpy(char * dest,const char *src)
{
char *tmp = dest;
while ((*dest++ = *src++) != '\0')
/* nothing */;
return tmp;
}
char * strncpy(char * dest,const char *src,size_t count)
{
char *tmp = dest;
while (count-- && (*dest++ = *src++) != '\0')
/* nothing */;
return tmp;
}
char * strcat(char * dest, const char * src)
{
char *tmp = dest;
while (*dest)
dest++;
while ((*dest++ = *src++) != '\0')
;
return tmp;
}
char * strncat(char *dest, const char *src, size_t count)
{
char *tmp = dest;
if (count) {
while (*dest)
dest++;
while ((*dest++ = *src++)) {
if (--count == 0)
break;
}
}
return tmp;
}
int strcmp(const char * cs,const char * ct)
{
register signed char __res;
while (1) {
if ((__res = *cs - *ct++) != 0 || !*cs++) /*is !*cs++ necessary? incase more cmp*/
break;
}
return __res;
}
int strncmp(const char * cs,const char * ct,size_t count)
{
register signed char __res = 0;
while (count) {
if ((__res = *cs - *ct++) != 0 || !*cs++)
break;
count--;
}
return __res;
}
char * strchr(const char * s,char c)
{
for(; *s != c; ++s)
if (*s == '\0')
return NULL;
return (char *) s;
}
size_t strlen(const char * s)
{
const char *sc;
for (sc = s; *sc != '\0'; ++sc)
/* nothing */;
return sc - s;
}
size_t strnlen(const char * s, size_t count)
{
const char *sc;
for (sc = s; *sc != '\0' && count--; ++sc)
/* nothing */;
return sc - s;
}
size_t strspn(const char *s, const char *accept)
{
const char *p;
const char *a;
size_t count = 0;
for (p = s; *p != '\0'; ++p) {
for (a = accept; *a != '\0'; ++a) {
if (*p == *a)
break;
}
if (*a == '\0')
return count;
++count;
}
return count;
}
char * strpbrk(const char * cs,const char * ct)
{
const char *sc1,*sc2;
for( sc1 = cs; *sc1 != '\0'; ++sc1) {


Ïà¹ØÎĵµ£º

ÔÚCºÍC£«£«Öаѱê×¼Êä³öÖض¨Ïòµ½Ö¸¶¨Îļþ

C++µÄʵÏÖ
#include<fstream>  
#include <iostream>
using namespace std;
int main()
{  
 ofstream logTest("foo.log");    
 streambuf *oldbuf = cout.rdbuf(logTest.rdbuf());   
  
 cout << "Êä³ö ......

Ò»¸öC²¡¶¾ !

//Á¬½ÓÍ·Îļþ
#include <io.h>
#include <dir.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
//¿½±´ÎļþÄ£¿é
int copyfile (char *infile, char *outfile)
{
    FILE *in,*out; //¶¨ÒåÎļþÖ¸Õë
    in = fopen(infile,"r"); //´ ......

¶Á¡¶CºÍÖ¸Õë¡·±Ê¼ÇÕªÒª¡¾6¡¿

2010-04-09
µÚÊ®ÎåÕ    ÊäÈë/Êä³öº¯Êý
1¡¢´íÎ󱨸æ
perrorº¯Êý     void perror( char const *message);
2¡¢ÖÕÖ¹Ö´ÐÐ
void exit( int status );    Ô­ÐͶ¨ÒåÓÚstdlib.h
ÆäÖÐstatus²ÎÊý·µ»Ø¸ø²Ù×÷ϵͳ£¬ÓÃÓÚÌáʾ³ÌÐòÊÇ·ñÕý³£Íê³É£¬Õâ¸öÖµºÍmainº¯Êý·µ»ØµÄÕûÐÍ״̬ ......

Linux»·¾³ÏÂÓÃcÓïÑÔдµÄ²¥·ÅwavÎļþµÄС³ÌÐò

#include <unistd.h>
#include <fcntl.h>
#include
<sys/types.h>
#include <sys/ioctl.h>
#include
<stdlib.h>
#include <stdio.h>
#include
<linux/soundcard.h>
/* ÏÂÃæµÄÈý¸ö²ÎÊýÊǸú¾ßÌåÎļþÏà¹ØµÄ£¬ÎļþʲôÑù£¬¾ÍÒªÉèÖóÉʲôÑù */
#define RATE 11025&nbs ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ