这篇教程C++ yesno函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中yesno函数的典型用法代码示例。如果您正苦于以下问题:C++ yesno函数的具体用法?C++ yesno怎么用?C++ yesno使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了yesno函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: DeleteListstatic void DeleteList()//START PROBLEM 3{ int boolean = 1; int content; struct node *head = NULL; while(boolean) { if(yesno("Would you like to enter a value (Y/N)?")) { read_int("Please enter your value: ", &content); AppendNode(&head, content); } else { boolean = 0; } } //Now delete the list if(yesno("Would you like to delete the list (Y/N)?")) { Delete_List(&head); } if(head == NULL) { printf("The head node has been set to NULL./n"); }}//END PROBLEM 3
开发者ID:rterry,项目名称:linked-list-problem-solutions,代码行数:29,
示例2: bputsvoid sbbs_t::sys_info(){ char tmp[128]; uint i; stats_t stats; bputs(text[SiHdr]); getstats(&cfg,0,&stats); bprintf(text[SiSysName],cfg.sys_name); bprintf(text[SiSysID],cfg.sys_id); /* QWK ID */ for(i=0;i<cfg.total_faddrs;i++) bprintf(text[SiSysFaddr],smb_faddrtoa(&cfg.faddr[i],tmp)); if(cfg.sys_psname[0]) /* PostLink/PCRelay */ bprintf(text[SiSysPsite],cfg.sys_psname,cfg.sys_psnum); bprintf(text[SiSysLocation],cfg.sys_location); bprintf(text[SiSysop],cfg.sys_op); bprintf(text[SiSysNodes],cfg.sys_nodes);// bprintf(text[SiNodeNumberName],cfg.node_num,cfg.node_name); bprintf(text[SiNodePhone],cfg.node_phone); bprintf(text[SiTotalLogons],ultoac(stats.logons,tmp)); bprintf(text[SiLogonsToday],ultoac(stats.ltoday,tmp)); bprintf(text[SiTotalTime],ultoac(stats.timeon,tmp)); bprintf(text[SiTimeToday],ultoac(stats.ttoday,tmp)); ver(); if(yesno(text[ViewSysInfoFileQ])) { CLS; sprintf(tmp,"%ssystem.msg", cfg.text_dir); printfile(tmp,0); } if(yesno(text[ViewLogonMsgQ])) { CLS; menu("logon"); }}
开发者ID:ftnapps,项目名称:pkg-sbbs,代码行数:34,
示例3: InsertNthstatic void InsertNth()//PROBLEM 5{ int boolean = 1; int content; struct node *head = NULL; while(boolean) { if(yesno("Would you like to enter a value (Y/N)?")) { read_int("Please enter your value: ", &content); Push(&head, content); } else { boolean = 0; } } boolean = 1; //reset boolean to default to prepare for next while loop while(boolean) { short int boolean2; short int boolean3 = 1; int value = 0; if(yesno("Would you like to insert a new node at an arbitrary position (Y/N)?")) { read_int("Enter the position for which you want to insert the node: ", &content); Insert_Nth(&head, content); printf("Now let's check the contents of the list./n"); while(boolean3) { read_int("Please enter your value to search for: ", &content); boolean2 = GetValue(head, content, &value); if(boolean2 == 0) { printf("The list is either empty or the value you entered is out of range./n"); } else { printf("The value of element %d is %d./n", content, value); } if(!yesno("Do you want to search for another value of an element (Y/N)?")) { boolean3 = 0; } } } else { boolean = 0; } } freeElements(&head);//free up the allocated memory if(head == NULL) { printf("The head node was set to NULL./n"); }}//END PROBLEM 5
开发者ID:rterry,项目名称:linked-list-problem-solutions,代码行数:60,
示例4: mainint main(void){ const uint8_t *json = (uint8_t*)"{ /"message/" : /"Hello World!/" }"; bson_error_t error; bson_t *doc; char *str; size_t len; if (!(doc = bson_new_from_json(json, -1, &error))) { fprintf(stderr, "Cannot initialize BSON structure from JSON example./n"); fprintf(stderr, "BSON error message: %s/n", error.message); return 1; } printf("Has key /"message/" (expect /"yes/") : %s/n", yesno(bson_has_field(doc, "message"))); printf("Has key /"triceratops/" (expect/"no/") : %s/n", yesno(bson_has_field(doc, "triceratops"))); str = bson_as_json(doc, &len); printf("Original JSON document : %s/n", json); printf("BSON-to-JSON conversion : %s/n", str); bson_free(str); bson_destroy(doc); return 0;}
开发者ID:indiedotkim,项目名称:xcode-automake-cmake,代码行数:28,
示例5: SortedIntersectionstatic void SortedIntersection()//PROBLEM 16{ int boolean = 1; int content; struct node *Ahead = NULL; struct node *Bhead = NULL; struct node *Chead = NULL; while(boolean) { if(yesno("Would you like to enter a value for Ahead (Y/N)?")) { read_int("Please enter your value: ", &content); Push(&Ahead, content); } else { boolean = 0; } Insert_Sort(&Ahead); } boolean = 1; while(boolean) { if(yesno("Would you like to enter a value for Bhead (Y/N)?")) { read_int("Please enter your value: ", &content); Push(&Bhead, content); } else { boolean = 0; } Insert_Sort(&Bhead); } PrintListData(Ahead); PrintListData(Bhead); PrintListData(Chead); Sorted_Intersection(&Ahead, &Bhead, &Chead); PrintListData(Ahead); PrintListData(Bhead); PrintListData(Chead); freeElements(&Ahead);//free up the allocated memory if(Ahead == NULL) { printf("The head node was set to NULL./n"); } freeElements(&Bhead);//free up the allocated memory if(Bhead == NULL) { printf("The head node was set to NULL./n"); } freeElements(&Chead);//free up the allocated memory if(Chead == NULL) { printf("The head node was set to NULL./n"); }}//END PROBLEM 16
开发者ID:rterry,项目名称:linked-list-problem-solutions,代码行数:59,
示例6: ISBSTstatic void ISBST()//PROBLEM 13 and 14{ int boolean = 1; struct node *head = NULL; int content; while(boolean) { if(yesno("Would you like to enter a value (Y/N)?")) { read_int("Please enter your value: ", &content); Append(&head, content); } else { boolean = 0; } } if(head == NULL) { printf("The tree is empty./n"); return; } Is_Search_Tree(head); freeElements(&head);//free up the allocated memory if(head == NULL) { printf("The head node was set to NULL./n"); } //Now enter the same nodes and make a non searchable tree boolean = 1; while(boolean) { if(yesno("Would you like to enter a value (Y/N)?")) { read_int("Please enter your value: ", &content); NonSearchableTree(&head, content); } else { boolean = 0; } } if(head == NULL) { printf("The tree is empty./n"); return; } Is_Search_Tree(head); freeElements(&head);//free up the allocated memory if(head == NULL) { printf("The head node was set to NULL./n"); }}//END PROBLEM 13 and 14
开发者ID:rterry,项目名称:iterative-binary-tree-solutions,代码行数:55,
示例7: edit_bitmapstatic void edit_bitmap(char *bitmap_file){ char *cmd; int editing = 1; printf("Editing contents of bitmap file: %s/n", bitmap_file); bmp_file_open(bitmap_file); do { show_layout(); printf("/nText colors:/n"); show_colors(0); show_timer(); printf("/nCommands are: L)ayout, C)olors, T)imer, Q)uit, W)rite: "); cmd = getLine(); switch(toupper(*cmd)) { case 'C': edit_colors(); break; case 'L': edit_layout(); break; case 'T': edit_timer(); break; case 'W': if (yesno("Save companion configuration file?", 0)) dat_file_creat(bitmap_file); editing = !yesno("Save changes to bitmap file?", 0); if (!editing) { printf("Writing output file: %s/n", bitmap_file); bmp_file_close(!test); /* update */ if (test) printf("***The bitmap file has not been changed***/n"); } break; case 'Q': editing = !yesno("Abandon changes?", 0); if (!editing) bmp_file_close(0); /* no update */ break; default: printf("???"); } free(cmd); printf("/n"); } while (editing); exit(0);}
开发者ID:OPSF,项目名称:uClinux,代码行数:49,
示例8: GetNthstatic void GetNth()//START PROBLEM 2{ int boolean = 1; int content; struct node *head = NULL; while(boolean) { if(yesno("Would you like to enter a value (Y/N)?")) { read_int("Please enter your value: ", &content); AppendNode(&head, content); } else { boolean = 0; } } boolean = 1; //reset boolean to default to prepare for next while loop while(boolean) { short int boolean2; int value = 0; if(yesno("Do you want to search for the value of an element (Y/N)?")) { read_int("Please enter your value to search for: ", &content); boolean2 = GetValue(head, content, &value); if(boolean2 == 0) { printf("The list is either empty or the value you entered is out of range./n"); } else { printf("The value of element %d is %d./n", content, value); } } else { boolean = 0; } } freeElements(&head);//free up the allocated memory if(head == NULL) { printf("The head node was set to NULL./n"); }}//END PROBLEM 2
开发者ID:rterry,项目名称:linked-list-problem-solutions,代码行数:49,
示例9: reset_roomvoidreset_room(){ int roomnum; char *quad_name; room_t scratch; memset(&scratch, 0, sizeof(room_t)); cprintf("Number of room to reset: "); quad_name = get_name(3); if (strlen(quad_name) < 1) return; roomnum = atoi(quad_name); scratch = readquad(roomnum); scratch.highest = 0; cprintf("Are you really sure you want to reset %s>?/n", scratch.name); if (yesno() == YES) { write_quad(scratch, roomnum); log_sysop_action("reset %s %d.%s>", config.forum, roomnum, scratch.name); } else { cprintf("Ok then. No resetting done this time./n/n"); } return;}
开发者ID:cafuego,项目名称:monolith,代码行数:29,
示例10: errmsg/* open a file for write */FILE *gapp_openw(GraceApp *gapp, const char *fn){ struct stat statb; char buf[GR_MAXPATHLEN + 50]; FILE *retval; if (!fn || !fn[0]) { errmsg("No file name given"); return NULL; } else if (strcmp(fn, "-") == 0 || strcmp(fn, "stdout") == 0) { return stdout; } else { if (stat(fn, &statb) == 0) { /* check to make sure this is a file and not a dir */ if (S_ISREG(statb.st_mode)) { sprintf(buf, "Overwrite %s?", fn); if (!yesno(buf, NULL, NULL, NULL)) { return NULL; } } else { sprintf(buf, "%s is not a regular file!", fn); errmsg(buf); return NULL; } } retval = filter_write(gapp, fn); if (!retval) { sprintf(buf, "Can't write to file %s, check permissions!", fn); errmsg(buf); } return retval; }}
开发者ID:astrotycoon,项目名称:grace,代码行数:34,
示例11: MinValuestatic void MinValue()//PROBLEM 4{ int boolean = 1; int content; int minvalue = 0; struct node *head = NULL; while(boolean) { if(yesno("Would you like to enter a value (Y/N)?")) { read_int("Please enter your value: ", &content); Append(&head, content); } else { boolean = 0; } } minvalue = Min_Value(head); printf("The depth of the tree is %d./n", minvalue); freeElements(&head);//free up the allocated memory if(head == NULL) { printf("The head node was set to NULL./n"); }}//END PROBLEM 4
开发者ID:rterry,项目名称:iterative-binary-tree-solutions,代码行数:28,
示例12: gfileeditvoid gfileedit() { int i; char s[81]; if (!ValidateSysopPassword()) { return; } showsec(); bool done = false; do { bout.nl(); bout << "|#2G-files: D:elete, I:nsert, M:odify, Q:uit, ? : "; char ch = onek("QDIM?"); switch (ch) { case '?': showsec(); break; case 'Q': done = true; break; case 'M': bout.nl(); bout << "|#2Section number? "; input(s, 2); i = atoi(s); if ((s[0] != 0) && (i >= 0) && (i < session()->num_sec)) { modify_sec(i); } break; case 'I': if (session()->num_sec < session()->max_gfilesec) { bout.nl(); bout << "|#2Insert before which section? "; input(s, 2); i = atoi(s); if ((s[0] != 0) && (i >= 0) && (i <= session()->num_sec)) { insert_sec(i); } } break; case 'D': bout.nl(); bout << "|#2Delete which section? "; input(s, 2); i = atoi(s); if ((s[0] != 0) && (i >= 0) && (i < session()->num_sec)) { bout.nl(); bout << "|#5Delete " << gfilesec[i].name << "?"; if (yesno()) { delete_sec(i); } } break; } } while (!done && !hangup); File gfileDat(syscfg.datadir, GFILE_DAT); gfileDat.Open(File::modeReadWrite | File::modeBinary | File::modeCreateFile | File::modeTruncate); gfileDat.Write(&gfilesec[0], session()->num_sec * sizeof(gfiledirrec)); gfileDat.Close();}
开发者ID:bhaggerty,项目名称:wwiv-1,代码行数:60,
示例13: DoubleTreestatic void DoubleTree()//PROBLEM 10{ int boolean = 1; int content; int depth; struct node *head = NULL; while(boolean) { if(yesno("Would you like to enter a value (Y/N)?")) { read_int("Please enter your value: ", &content); Append(&head, content); } else { boolean = 0; } } if(head == NULL) { printf("The tree is empty./n"); return; } depth = Max_Depth(head); Print_Paths(head, depth); Double_Tree(head); Print_Paths(head, depth); freeElements(&head);//free up the allocated memory if(head == NULL) { printf("The head node was set to NULL./n"); }}//END PROBLEM 10
开发者ID:rterry,项目名称:iterative-binary-tree-solutions,代码行数:34,
示例14: PrintTreestatic void PrintTree()//PROBLEM 5{ int boolean = 1; int content; struct node *head = NULL; while(boolean) { if(yesno("Would you like to enter a value (Y/N)?")) { read_int("Please enter your value: ", &content); Append(&head, content); } else { boolean = 0; } } Print_Tree(head); freeElements(&head);//free up the allocated memory if(head == NULL) { printf("The head node was set to NULL./n"); }}//END PROBLEM 5
开发者ID:rterry,项目名称:iterative-binary-tree-solutions,代码行数:26,
示例15: returnbool sbbs_t::lookup_netuser(char *into){ char to[128],name[26],str[256],q[128]; int i; FILE *stream; if(strchr(into,'@')) return(false); strcpy(to,into); strupr(to); sprintf(str,"%sqnet/users.dat", cfg.data_dir); if((stream=fnopen(&i,str,O_RDONLY))==NULL) return(false); while(!feof(stream)) { if(!fgets(str,sizeof(str),stream)) break; str[25]=0; truncsp(str); strcpy(name,str); strupr(name); str[35]=0; truncsp(str+27); sprintf(q,"Do you mean %s @%s",str,str+27); if(strstr(name,to) && yesno(q)) { fclose(stream); sprintf(into,"%[email C++ yexception函数代码示例 C++ yes_no函数代码示例
|