⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 getopt.c

📁 决策树是用二叉树形图来表示处理逻辑的一种工具。可以直观、清晰地表达加工的逻辑要求。特别适合于判断因素比较少、逻辑组合关系不复杂的情况。
💻 C
字号:
/*************************************************************************//*									 *//*  This file is included in case your version of Unix doesn't include   *//*  the getopt utility.  If it does, discard this file and amend the     *//*  Makefile accordingly.						 *//*									 *//*  There is no copyright on this file.					 *//*									 *//*************************************************************************/#include <stdio.h>int optind = 1;char *optarg;    getopt(Argc, Argv, Str)/*  ------  */    int Argc;    char **Argv, *Str;{    int Optchar;    char *Option;    if ( optind >= Argc ) return EOF;    Option = Argv[optind++];    if ( *Option++ != '-' ) return '?';    Optchar = *Option++;    while ( *Str && *Str != Optchar ) Str++;    if ( ! *Str ) return '?';    if ( *++Str == ':' )    {	if ( *Option ) optarg = Option;	else	if ( optind < Argc ) optarg = Argv[optind++];	else	Optchar = '?';    }    return Optchar;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -