📄 getword.c
字号:
/************************************************************* * File: lib/getword.c * Purpose: Part of C runtime library * Author: Phil Bunce (pjb@carmel.com) * Revision History: * 970304 Start of revision history */#include "string.h"/************************************************************** char *getword(dst,p) * copies next word from p into dst, else rtns 0 */char *getword(dst,p)char *p,*dst;{char *a;if (!dst || !p) return(0);dst[0] = 0;while (isspace(*p)) p++;if (*p == 0) return(0);a = p;while (!isspace(*p) && *p != 0) p++;strncpy(dst,a,p-a);dst[p-a] = 0;return(p);}/* int wordsz(p) return size of first word in p */int wordsz(p)char *p;{int n;if (!p) return(0);while (isspace(*p)) p++;for (n=0;! *p && ! isspace(*p);n++) p++;return(n);}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -