c 字符串处理函数 strtok 源码
/***
*strtok.c - tokenize a string with given delimiters
*
* Copyright (c) Microsoft Corporation. All rights reserved.
*
*Purpose:
* defines strtok() - breaks string into series of token
* via repeated calls.
*
*******************************************************************************/
#include
#include
#ifdef _SECURE_VERSION
#include
#else /* _SECURE_VERSION */
#include
#endif /* _SECURE_VERSION */
/***
*char *strtok(string, control) - tokenize string with delimiter in control
*
*Purpose:
* strtok considers the string to consist of a sequence of zero or more
* text tokens separated by spans of one or more control chars. the first
* call, with string specified, returns a pointer to the first char of the
* first token, and will write a null char into string immediately
* following the returned token. subsequent calls with zero for the first
* argument (string) will work thru the string until no tokens remain. the
* control string may be different from call to call. when no tokens remain
* in string a NULL pointer is returned. remember the control chars with a
* bit map, one bit per ascii char. the null char is always a control char.
*
*Entry:
* char *string - string to tokenize, or NULL to get next token
* char *control - string of characters to use as delimiters
*
*Exit:
* returns pointer to first token in string, or if string
* was NULL, to next token
* returns NULL when no more tokens remain.
*
*Uses:
*
*Exceptions:
*
*******************************************************************************/
#ifdef _SECURE_VERSION
#define _TOKEN *context
#else /* _SECURE_VERSION */
#define _TOKEN ptd->_token
#endif /* _SECURE_VERSION */
#ifdef _SECURE_VERSION
char * __cdecl strtok_s (
char * string,
const char * control,
char ** context
)
#else /* _SECURE_VERSION */
char *
相关文档:
众多C++书籍都忠告我们C语言宏是万恶之首,但事情总不如我们想象的那么坏,就如同goto一样。宏有
一个很大的作用,就是自动为我们产生代码。如果说模板可以为我们产生各种型别的代码(型别替换),
那么宏其实可以为我们在符号上产生新的代码(即符号替换、增加)。
关于宏的一些语法问题,可以在google上找到。相信我,你 ......
第一个问题,百钱百鸡,囧到了
#include<stdio.h>
void main()
{
int cocks=0,hens=0,chicks=0;
while(cocks<=19)
{
while(hens<=33)
{
chicks=100-cocks-hens;
if((cocks+hens+chicks==100)&&(cocks*5+hens*3+chicks/3==100))
printf("cocks= ......
对野指针的一些认识:
我对野指针的认识,我觉得野指针就是一个指针变量它里面的值是不确定的,这样当你操作这个变量所指定的内存地址的时候,就会带来一些不确定的因素,拿一个比较常见的问题来举个例子来说明一下:
看下面代码:
int a = 10;
int *p;
*p = a;
1. ......
1.打开“我的电脑”-“工具”-“文件夹选项”-“查看”-在“显示所有文件和文件夹”选项前打勾-“确定”
2.删除以下文件夹中的内容:
x:\Documents and Settings\用户名\Cookies\下的所有文件(保留index文件)
x:\Documents and Settings\用户名\Local Settings\Temp\下的所有文件(用户临时文件)
x:\ ......
W3C标准的HTML标签
按功能类别排列
DTD:指示在哪种 XHTML 1.0 DTD 中允许该标签。
S=Strict,严格类型, T=Transitional,过渡类型【最普遍】, F=Frameset,框架类型.
标签成对,xhtml是比html更严格,类似XML格式
标签描述DTD
<!DOCTYPE>
定义文档类型。
STF
<html>
定义 HTML 文档。
STF
< ......