#define _CRT_SECURE_NO_WARNINGS#include<string.h>#include<stdio.h>char string[]="A string\tof ,,tokens\nand some more tokens";char seps[]=" ,\t\n";char*token;intmain(void){printf("Tokens:\n");// Establish string and get the first token:token =strtok(string, seps);// C4996// Note: strtok is deprecated; consider using strtok_s insteadwhile(token !=NULL){// While there are tokens in "string"printf(" %s\n", token);// Get next token: token =strtok(NULL, seps);// C4996}}/*int i = -1;do{pDest[++i] = pSource[i];} while (pSource[i]);
*/voidStringCopy(char* pDest,char* pSource)//微软源码{int i =-1;while(pDest[++i]= pSource[i]);}voidStrCopy(char* pDest,char* pSrc){while(*pDest=*pSrc){++pDest;++pSrc;}}voidStrCat(char* pDest,char* pSrc){int i=0,j=0;while(pDest[i]!=0)++i;while(pDest[i++]=pSrc[j++]);}voidStrCat1(char* pDest,char* pSrc){while(*pDest)++pDest;while(*pDest =*pSrc)++pDest,++pSrc;}intStrCmp(char* s1,char* s2){unsignedchar* p1 =(unsignedchar*)s1;unsignedchar* p2 =(unsignedchar*)s2;while(*p1 &&*p1++==*p2++);return*p1 -*p2;}