您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ ExitProgram函数代码示例

51自学网 2021-06-01 20:39:57
  C++
这篇教程C++ ExitProgram函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中ExitProgram函数的典型用法代码示例。如果您正苦于以下问题:C++ ExitProgram函数的具体用法?C++ ExitProgram怎么用?C++ ExitProgram使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了ExitProgram函数的29个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: main

/* * This demonstrates the Cdk preprocess feature. */int main (void){   /* *INDENT-EQLS* */   CDKSCREEN *cdkscreen = 0;   CDKENTRY *widget     = 0;   const char *title    = "<C>Type in anything you want/n<C>but the dreaded letter </B>G<!B>!";   char *info;   const char *mesg[10];   char temp[256];   cdkscreen = initCDKScreen (NULL);   /* Start CDK colors. */   initCDKColor ();   /* Create the entry field widget. */   widget = newCDKEntry (cdkscreen, CENTER, CENTER,			 title, 0, A_NORMAL, '.', vMIXED,			 40, 0, 256, TRUE, FALSE);   /* Is the widget null? */   if (widget == 0)   {      /* Clean up. */      destroyCDKScreen (cdkscreen);      endCDK ();      printf ("Cannot create the entry box. Is the window too small?/n");      ExitProgram (EXIT_FAILURE);   }   setCDKEntryPreProcess (widget, entryPreProcessCB, 0);   /* Activate the entry field. */   info = activateCDKEntry (widget, 0);   /* Tell them what they typed. */   if (widget->exitType == vESCAPE_HIT)   {      mesg[0] = "<C>You hit escape. No information passed back.";      mesg[1] = "",	 mesg[2] = "<C>Press any key to continue.";      popupLabel (cdkscreen, (CDK_CSTRING2)mesg, 3);   }   else if (widget->exitType == vNORMAL)   {      mesg[0] = "<C>You typed in the following";      sprintf (temp, "<C>(%.*s)", (int)(sizeof (temp) - 20), info);      mesg[1] = temp;      mesg[2] = "";      mesg[3] = "<C>Press any key to continue.";      popupLabel (cdkscreen, (CDK_CSTRING2)mesg, 4);   }   /* Clean up and exit. */   destroyCDKEntry (widget);   destroyCDKScreen (cdkscreen);   endCDK ();   ExitProgram (EXIT_SUCCESS);}
开发者ID:ThomasDickey,项目名称:cdk-snapshots,代码行数:63,


示例2: main

int main(int argc, char **argv){   /* Declare variables. */   CDKSCREEN	*cdkscreen;   CDKLABEL	*demo;   WINDOW	*cursesWin;   char		*mesg[4];   CDK_PARAMS params;   CDKparseParams(argc, argv, &params, CDK_MIN_PARAMS);   /* Set up CDK. */   cursesWin = initscr();   cdkscreen = initCDKScreen (cursesWin);   /* Start CDK Colors. */   initCDKColor();   /* Set the labels up. */   mesg[0] = "</5><#UL><#HL(30)><#UR>";   mesg[1] = "</5><#VL(10)>Hello World!<#VL(10)>";   mesg[2] = "</5><#LL><#HL(30)><#LR>";   /* Declare the labels. */   demo = newCDKLabel (cdkscreen,		       CDKparamValue(&params, 'X', CENTER),		       CDKparamValue(&params, 'Y', CENTER),		       mesg, 3,		       CDKparamValue(&params, 'N', TRUE),		       CDKparamValue(&params, 'S', TRUE));   setCDKLabelBackgroundAttrib (demo, COLOR_PAIR(2));   /* Is the label null? */   if (demo == 0)   {      /* Clean up the memory. */      destroyCDKScreen (cdkscreen);      /* End curses... */      endCDK();      /* Spit out a message. */      printf ("Oops. Can't seem to create the label. Is the window too small?/n");      ExitProgram (EXIT_FAILURE);   }   /* Draw the CDK screen. */   refreshCDKScreen (cdkscreen);   waitCDKLabel (demo, ' ');   /* Clean up. */   destroyCDKLabel (demo);   destroyCDKScreen (cdkscreen);   endCDK();   ExitProgram (EXIT_SUCCESS);}
开发者ID:iamjamestl,项目名称:school,代码行数:58,


示例3: do_options

static voiddo_options(int c, char *op[]){    register int i;    if (c > 1) {	for (i = 1; i < c; i++) {	    switch (op[i][0]) {	    default:	    case '?':		(void) fprintf(stderr, "Usage: battle [-s | -b] [-c]/n");		(void) fprintf(stderr, "/tWhere the options are:/n");		(void) fprintf(stderr, "/t-s : play a salvo game/n");		(void) fprintf(stderr, "/t-b : play a blitz game/n");		(void) fprintf(stderr, "/t-c : ships may be adjacent/n");		ExitProgram(EXIT_FAILURE);		break;	    case '-':		switch (op[i][1]) {		case 'b':		    blitz = 1;		    if (salvo == 1) {			(void) fprintf(stderr,				       "Bad Arg: -b and -s are mutually exclusive/n");			ExitProgram(EXIT_FAILURE);		    }		    break;		case 's':		    salvo = 1;		    if (blitz == 1) {			(void) fprintf(stderr,				       "Bad Arg: -s and -b are mutually exclusive/n");			ExitProgram(EXIT_FAILURE);		    }		    break;		case 'c':		    closepack = 1;		    break;		default:		    (void) fprintf(stderr,				   "Bad arg: type /"%s ?/" for usage message/n",				   op[0]);		    ExitProgram(EXIT_FAILURE);		}	    }	}    }}
开发者ID:tizenorg,项目名称:external.ncurses,代码行数:48,


示例4: usage

static voidusage(void){#define SKIP(s)			/* nothing */#define KEEP(s) s "/n"    static const char msg[] =    {	KEEP("")	KEEP("Options:")	SKIP("  -a arpanet  (obsolete)")	KEEP("  -c          set control characters")	SKIP("  -d dialup   (obsolete)")	KEEP("  -e ch       erase character")	KEEP("  -I          no initialization strings")	KEEP("  -i ch       interrupt character")	KEEP("  -k ch       kill character")	KEEP("  -m mapping  map identifier to type")	SKIP("  -p plugboard (obsolete)")	KEEP("  -Q          do not output control key settings")	KEEP("  -q          display term only, do no changes")	KEEP("  -r          display term on stderr")	SKIP("  -S          (obsolete)")	KEEP("  -s          output TERM set command")	KEEP("  -V          print curses-version")	KEEP("  -w          set window-size")	KEEP("")	KEEP("If neither -c/-w are given, both are assumed.")    };#undef KEEP#undef SKIP    (void) fprintf(stderr, "Usage: %s [options] [terminal]/n", _nc_progname);    fputs(msg, stderr);    ExitProgram(EXIT_FAILURE);    /* NOTREACHED */}
开发者ID:ThomasDickey,项目名称:ncurses-snapshots,代码行数:35,


示例5: bye_kids

/***	bye_kids(exit-condition)****	Shutdown the terminal, clear the signals, and exit*/voidbye_kids(int n){				/* reset the tty and exit */	ignoresig();	if (send_reset_init) {		if (exit_ca_mode) {			tc_putp(exit_ca_mode);		}		if (initial_stty_query(TTY_XON_XOFF)) {			if (enter_xon_mode) {				tc_putp(enter_xon_mode);			}		} else if (exit_xon_mode) {			tc_putp(exit_xon_mode);		}	}	if (debug_fp) {		fclose(debug_fp);	}	if (log_fp) {		fclose(log_fp);	}	tty_reset();	fclose(stdin);	fclose(stdout);	fclose(stderr);	if (not_a_tty)		sleep(1);	ExitProgram(n);}
开发者ID:SamB,项目名称:debian-tack,代码行数:35,


示例6: main

intmain(int argc, char *argv[]){    WINDOW *stsbox;    WINDOW *stswin;    setlocale(LC_ALL, "");    if (argc < 2) {	fprintf(stderr, "usage: %s file/n", argv[0]);	return EXIT_FAILURE;    }    initscr();    test_set_escdelay();    test_set_tabsize();    stsbox = derwin(stdscr, BASE_Y, COLS, 0, 0);    box(stsbox, 0, 0);    wnoutrefresh(stsbox);    stswin = derwin(stsbox, BASE_Y - 2, COLS - 2, 1, 1);    keypad(stswin, TRUE);    test_opaque(1, argv, stswin);    endwin();    ExitProgram(EXIT_SUCCESS);}
开发者ID:SayCV,项目名称:rtems-addon-packages,代码行数:30,


示例7: die

static voiddie(int onsig){    (void) signal(onsig, SIG_IGN);    endwin();    ExitProgram(EXIT_SUCCESS);}
开发者ID:ThomasDickey,项目名称:ncurses-snapshots,代码行数:7,


示例8: main

intmain(int argc, char *argv[]){    WINDOW *chrbox;    WINDOW *chrwin;    WINDOW *strwin;    setlocale(LC_ALL, "");    if (argc < 2) {	fprintf(stderr, "usage: %s file/n", argv[0]);	return EXIT_FAILURE;    }    initscr();    chrbox = derwin(stdscr, BASE_Y, COLS, 0, 0);    box(chrbox, 0, 0);    wnoutrefresh(chrbox);    chrwin = derwin(chrbox, 1, COLS - 2, 1, 1);    strwin = derwin(chrbox, 4, COLS - 2, 2, 1);    test_inchs(1, argv, chrwin, strwin);    endwin();    ExitProgram(EXIT_SUCCESS);}
开发者ID:AaronDP,项目名称:ncurses-5.9_adbshell,代码行数:28,


示例9: failed

static voidfailed(const char *msg){    perror(msg);    cleanup();    ExitProgram(EXIT_FAILURE);}
开发者ID:CSU-GH,项目名称:okl4_3.0,代码行数:7,


示例10: failed

static voidfailed(const char *s){    perror(s);    endwin();    ExitProgram(EXIT_FAILURE);}
开发者ID:Scarletts,项目名称:LiteBSD,代码行数:7,


示例11: usage

static voidusage(void){    static const char *msg[] =    {	"Usage: demo_terminfo [options] [terminal]",	"",	"If no options are given, print all (boolean, numeric, string)",	"capabilities for the given terminal, using short names.",	"",	"Options:",	" -b       print boolean-capabilities",	" -f       print full names",	" -n       print numeric-capabilities",	" -r COUNT repeat for given count",	" -s       print string-capabilities",#ifdef NCURSES_VERSION	" -x       print extended capabilities",#endif    };    unsigned n;    for (n = 0; n < SIZEOF(msg); ++n) {	fprintf(stderr, "%s/n", msg[n]);    }    ExitProgram(EXIT_FAILURE);}
开发者ID:ysleu,项目名称:RTL8685,代码行数:26,


示例12: onsig

static voidonsig(int n GCC_UNUSED){    interrupted = TRUE;    cleanup();    ExitProgram(EXIT_FAILURE);}
开发者ID:Claruarius,项目名称:stblinux-2.6.37,代码行数:7,


示例13: onsig

static voidonsig(int n GCC_UNUSED){    curs_set(1);    endwin();    ExitProgram(EXIT_FAILURE);}
开发者ID:Scarletts,项目名称:LiteBSD,代码行数:7,


示例14: main

intmain(int argc, char *argv[]){    int ch;    char buffer[80];    attr_t underline;    bool i_option = FALSE;    setlocale(LC_ALL, "");    while ((ch = getopt(argc, argv, "i")) != -1) {	switch (ch) {	case 'i':	    i_option = TRUE;	    break;	default:	    usage();	}    }    printf("starting filter program using %s.../n",	   i_option ? "initscr" : "newterm");    filter();    if (i_option) {	initscr();    } else {	(void) newterm((char *) 0, stdout, stdin);    }    cbreak();    keypad(stdscr, TRUE);    if (has_colors()) {	int background = COLOR_BLACK;	start_color();#if HAVE_USE_DEFAULT_COLORS	if (use_default_colors() != ERR)	    background = -1;#endif	init_pair(1, COLOR_CYAN, (short) background);	underline = (attr_t) COLOR_PAIR(1);    } else {	underline = A_UNDERLINE;    }    while (new_command(buffer, sizeof(buffer) - 1, underline) != ERR	   && strlen(buffer) != 0) {	reset_shell_mode();	printf("/n");	fflush(stdout);	IGNORE_RC(system(buffer));	reset_prog_mode();	touchwin(stdscr);	erase();	refresh();    }    printw("done");    refresh();    endwin();    ExitProgram(EXIT_SUCCESS);}
开发者ID:chitranshi,项目名称:ncurses,代码行数:60,


示例15: main

intmain(int argc, char *argv[]){    int n;    int repeat;    char *name;    int r_opt = 1;    while ((n = getopt(argc, argv, "bfnr:sx")) != -1) {	switch (n) {	case 'b':	    b_opt = TRUE;	    break;	case 'f':	    f_opt = TRUE;	    break;	case 'n':	    n_opt = TRUE;	    break;	case 'r':	    if ((r_opt = atoi(optarg)) <= 0)		usage();	    break;	case 's':	    s_opt = TRUE;	    break;#ifdef NCURSES_VERSION	case 'x':	    x_opt = TRUE;	    use_extended_names(TRUE);	    break;#endif	default:	    usage();	    break;	}    }    if (!(b_opt || n_opt || s_opt || x_opt)) {	b_opt = TRUE;	n_opt = TRUE;	s_opt = TRUE;    }    for (repeat = 0; repeat < r_opt; ++repeat) {	if (optind < argc) {	    for (n = optind; n < argc; ++n) {		demo_terminfo(argv[n]);	    }	} else if ((name = getenv("TERM")) != 0) {	    demo_terminfo(name);	} else {	    static char dumb[] = "dumb";	    demo_terminfo(dumb);	}    }    ExitProgram(EXIT_SUCCESS);}
开发者ID:ysleu,项目名称:RTL8685,代码行数:59,


示例16: QMainWindow

XilinxGUI::XilinxGUI(QWidget *parent, Qt::WindowFlags flags)	: QMainWindow(parent, flags){	ui.setupUi(this);	QObject::connect(ui.actExit, SIGNAL(triggered()), this, SLOT(ExitProgram()));    QObject::connect(ui.btnShowPic, SIGNAL(clicked()), this, SLOT(ShowPic()));}
开发者ID:Varyier,项目名称:xilinx_cw,代码行数:8,


示例17: FatalError

static voidFatalError(const char *f,...){    va_list args;    va_start(args, f);    vfprintf(stderr, f, args);    va_end(args);    ExitProgram(1);}
开发者ID:aosm,项目名称:X11apps,代码行数:9,


示例18: exit_error

static voidexit_error(void){    restore_tty_settings();    (void) fprintf(stderr, "/n");    fflush(stderr);    ExitProgram(EXIT_FAILURE);    /* NOTREACHED */}
开发者ID:ThomasDickey,项目名称:ncurses-snapshots,代码行数:9,


示例19: sighndl

static RETSIGTYPEsighndl(int signo){    signal(signo, sighndl);    sigtermed = signo;    if (redirected) {	endwin();	ExitProgram(EXIT_FAILURE);    }}
开发者ID:AaronDP,项目名称:ncurses-5.9_adbshell,代码行数:10,


示例20: exit_error

static voidexit_error(void){    if (can_restore)	SET_TTY(STDERR_FILENO, &original);    (void) fprintf(stderr, "/n");    fflush(stderr);    ExitProgram(EXIT_FAILURE);    /* NOTREACHED */}
开发者ID:ajinkya93,项目名称:OpenBSD,代码行数:10,


示例21: uninitgame

static RETSIGTYPE uninitgame(int sig GCC_UNUSED)/* end the game, either normally or due to signal */{    clear();    (void) refresh();    (void) reset_shell_mode();    (void) echo();    (void) endwin();    ExitProgram(sig ? EXIT_FAILURE : EXIT_SUCCESS);}
开发者ID:ipwndev,项目名称:DSLinux-Mirror,代码行数:10,


示例22: GetInput

void GetInput() {	int ch;	static int chtmp;	int tmp;	ch = getch();	//Buffer input	if(ch == ERR) ch = chtmp;	chtmp = ch;	switch (ch) {		case KEY_UP:    case 'w': case 'W':			if(Loc[4][0] == 0) tmp = 28;			else tmp = Loc[4][0] - 1;			if((Level[tmp][Loc[4][1]] != 1)			&& (Level[tmp][Loc[4][1]] != 4))				{ Dir[4][0] = -1; Dir[4][1] =  0; }			break;		case KEY_DOWN:  case 's': case 'S':			if(Loc[4][0] == 28) tmp = 0;			else tmp = Loc[4][0] + 1;			if((Level[tmp][Loc[4][1]] != 1)			&& (Level[tmp][Loc[4][1]] != 4))				{ Dir[4][0] =  1; Dir[4][1] =  0; }			break;		case KEY_LEFT:  case 'a': case 'A':			if(Loc[4][1] == 0) tmp = 27;			else tmp = Loc[4][1] - 1;			if((Level[Loc[4][0]][tmp] != 1)			&& (Level[Loc[4][0]][tmp] != 4))				{ Dir[4][0] =  0; Dir[4][1] = -1; }			break;		case KEY_RIGHT: case 'd': case 'D':			if(Loc[4][1] == 27) tmp = 0;			else tmp = Loc[4][1] + 1;			if((Level[Loc[4][0]][tmp] != 1)			&& (Level[Loc[4][0]][tmp] != 4))				{ Dir[4][0] =  0; Dir[4][1] =  1; }			break;		case 'p': case 'P':			PauseGame();			chtmp = getch();			break;		case 'q': case 'Q':			ExitProgram("Bye");			break;	}}
开发者ID:esanwit,项目名称:os3_es,代码行数:55,


示例23: main

intmain(int argc, char *argv[]){    int ch;    setlocale(LC_ALL, "");    while ((ch = getopt(argc, argv, "dj:m:o:t:")) != -1) {	switch (ch) {	case 'd':	    d_option = TRUE;	    break;	case 'j':	    j_value = atoi(optarg);	    if (j_value < NO_JUSTIFICATION		|| j_value > JUSTIFY_RIGHT)		usage();	    break;	case 'm':	    m_value = atoi(optarg);	    break;	case 'o':	    o_value = atoi(optarg);	    break;	case 't':	    t_value = optarg;	    break;	default:	    usage();	}    }    initscr();    cbreak();    noecho();    raw();    nonl();			/* lets us read ^M's */    intrflush(stdscr, FALSE);    keypad(stdscr, TRUE);    if (has_colors()) {	start_color();	init_pair(1, COLOR_WHITE, COLOR_BLUE);	init_pair(2, COLOR_GREEN, COLOR_BLACK);	init_pair(3, COLOR_CYAN, COLOR_BLACK);	bkgd((chtype) COLOR_PAIR(1));	refresh();    }    demo_forms();    endwin();    ExitProgram(EXIT_SUCCESS);}
开发者ID:geho,项目名称:android_ncurses,代码行数:55,


示例24: main

intmain(int argc, char *argv[]){    int c;    bool monochrome = FALSE;    InitPanel myInit = init_panel;    FillPanel myFill = fill_panel;    setlocale(LC_ALL, "");    while ((c = getopt(argc, argv, "i:o:mwx")) != -1) {	switch (c) {	case 'i':	    log_in = fopen(optarg, "r");	    break;	case 'o':	    log_out = fopen(optarg, "w");	    break;	case 'm':	    monochrome = TRUE;	    break;#if USE_WIDEC_SUPPORT	case 'w':	    myInit = init_wide_panel;	    myFill = fill_wide_panel;	    break;#endif	case 'x':	    unboxed = TRUE;	    break;	default:	    usage();	}    }    if (unboxed)	myFill = fill_unboxed;    initscr();    cbreak();    noecho();    keypad(stdscr, TRUE);    use_colors = monochrome ? FALSE : has_colors();    if (use_colors)	start_color();    demo_panels(myInit, myFill);    endwin();    close_input();    close_output();    ExitProgram(EXIT_SUCCESS);}
开发者ID:Scarletts,项目名称:LiteBSD,代码行数:54,


示例25: quit

static voidquit(int status, const char *fmt,...){    va_list argp;    va_start(argp, fmt);    fprintf(stderr, "%s: ", prg_name);    vfprintf(stderr, fmt, argp);    fprintf(stderr, "/n");    va_end(argp);    ExitProgram(status);}
开发者ID:BA3IK,项目名称:node-ncurses,代码行数:12,


示例26: failed

static voidfailed(const char *msg){    int code = errno;    (void) fprintf(stderr, "%s: %s: %s/n", _nc_progname, msg, strerror(code));    restore_tty_settings();    (void) fprintf(my_file, "/n");    fflush(my_file);    ExitProgram(ErrSystem(code));    /* NOTREACHED */}
开发者ID:mirror,项目名称:ncurses,代码行数:12,


示例27: main

intmain(int argc, char *argv[]){    if (argc > 1) {	railroad(argv + 1);    } else {	static char world[] = "Hello World";	static char *hello[] =	{world, 0};	railroad(hello);    }    ExitProgram(EXIT_SUCCESS);}
开发者ID:Claruarius,项目名称:stblinux-2.6.37,代码行数:13,


示例28: usage

static voidusage(void){    static const char *msg[] =    {	"Usage: filter [options]"	,""	,"Options:"	,"  -i   use initscr() rather than newterm()"    };    unsigned n;    for (n = 0; n < SIZEOF(msg); n++)	fprintf(stderr, "%s/n", msg[n]);    ExitProgram(EXIT_FAILURE);}
开发者ID:chitranshi,项目名称:ncurses,代码行数:15,


示例29: randomfire

static voidrandomfire(int *px, int *py)/* random-fire routine -- implements simple diagonal-striping strategy */{    static int turncount = 0;    static int srchstep = BEGINSTEP;    static int huntoffs;	/* Offset on search strategy */    int ypossible[BWIDTH * BDEPTH], xpossible[BWIDTH * BDEPTH], nposs;    int ypreferred[BWIDTH * BDEPTH], xpreferred[BWIDTH * BDEPTH], npref;    int x, y, i;    if (turncount++ == 0)	huntoffs = rnd(srchstep);    /* first, list all possible moves */    nposs = npref = 0;    for (x = 0; x < BWIDTH; x++)	for (y = 0; y < BDEPTH; y++)	    if (!hits[COMPUTER][x][y]) {		xpossible[nposs] = x;		ypossible[nposs] = y;		nposs++;		if (((x + huntoffs) % srchstep) != (y % srchstep)) {		    xpreferred[npref] = x;		    ypreferred[npref] = y;		    npref++;		}	    }    if (npref) {	i = rnd(npref);	*px = xpreferred[i];	*py = ypreferred[i];    } else if (nposs) {	i = rnd(nposs);	*px = xpossible[i];	*py = ypossible[i];	if (srchstep > 1)	    --srchstep;    } else {	error("No moves possible?? Help!");	ExitProgram(EXIT_FAILURE);	/*NOTREACHED */    }}
开发者ID:tizenorg,项目名称:external.ncurses,代码行数:48,



注:本文中的ExitProgram函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ ExitThread函数代码示例
C++ ExitProcess函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。