• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ cputs函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: newint24h

    void __interrupt newint24h(dword rgs, dword rfs, dword res, dword rds,
                               dword redi, dword resi, dword rebp, dword resp,
                               dword rebx, dword redx, dword recx,
                               dword volatile reax)
    {
      NW(redi); NW(redx); NW(recx); NW(rebx); NW(rebp); NW(resi);
      NW(resp); NW(rds); NW(res); NW(rfs); NW(rgs);

      if (reax & 0x8000)
      {
        cputs("Critical error ");

        cputs((reax & 0x0100) ? "writing " : "reading ");
        cputs("drive ");
        putch('A'+(char)(reax & 0xff));
        cputs(":\r\n");
      }
      else
      {
        cputs("Critical error accessing device\r\n");
      }

      reax=3; /* FAIL error code */
      return;
    }
开发者ID:klamonte,项目名称:maximus,代码行数:25,代码来源:crit.c


示例2: alf

/*************************СОРТИРОВКА ПА АЛФАВИТУ*************************/
void alf(void)
{
 FILE *f,*f1;
 char filename[14],nameoffile[14];
 char c;
 int i,n=0,j,k,fl;
 instr smass[100],old;

 window(1,1,80,25);
 textbackground(0);
 textcolor(3);
 clrscr();
 cputs("Введите имя файла-источника данных...");
 scanf("%s",filename);
 cputs("Введите имя файла,в который будут записаны данные...");
 scanf("%s",nameoffile);
 f=fopen(filename,"r");
 f1=fopen(nameoffile,"aw");
 fseek(f,0,SEEK_SET);
 while(!feof(f))
  {
   fread(&smass[n],sizeof(old),1,f);
   n++;
  }
 n--;
 for (i=n-1;i>0;i--)
   {
     for (j=0;j<i;j++)
       {
	 fl=TRUE;
	 k=0;
	 while ((k<10)AND(fl==TRUE))
	   {
	     if (smass[j].name[k]>smass[j+1].name[k])
		{
		  old=smass[j];
		  smass[j]=smass[j+1];
		  smass[j+1]=old;
		  fl=FALSE;
		}
	     if (smass[j].name[k]<smass[j+1].name[k])
		fl=FALSE;
	     k++;
	   }
       }
   }
 printf("Мнемокод    Длина  Машинный код\n");
 for (i=0;i<n;i++)
   {
   fwrite (&smass[i],sizeof(old),1,f1);
   printf("%s",&smass[i].name);
   gotoxy(15,wherey());
   printf("%s",&smass[i].size);
   gotoxy(18,wherey());
   printf("%s\n",&smass[i].hex);
   }
 fcloseall();
 cputs("Обработка завершена...");
 getch();
}
开发者ID:majioa,项目名称:majioa-master-deg-n-thesis,代码行数:61,代码来源:SKRYLEV.C


示例3: draw_menu

void draw_menu(struct ctk_menu *m, struct ctk_menu *open) {
#if CC_CONF_UNSIGNED_CHAR_BUGS
  unsigned char x2;
  unsigned int x, y;
#else
  unsigned char x2;
  unsigned char x, y;
#endif
  x = cursx;
  cputs(m->title);
  cputc(CH_SPACE);

  if (m == open) {
    x2 = cursx;
    if(x + CTK_CONF_MENUWIDTH > SCREEN_WIDTH) {
      x = SCREEN_WIDTH - CTK_CONF_MENUWIDTH;
    }
  
    for(y = 0; y < m->nitems; y++) {
      if(y == m->active) {
	revers(0);
      }
      gotoxy(x, y + 1);
      if(m->items[y].title[0] == '-') {
	chline(CTK_CONF_MENUWIDTH);
      } else {
	cputs(m->items[y].title);
      }
      clearTo(x + CTK_CONF_MENUWIDTH);
      revers(1);
    }
    gotoxy(x2, 0);
  }
}
开发者ID:AlphaBetaPhi,项目名称:contiki,代码行数:34,代码来源:ctk-conio_arch-source.c


示例4: testcollisions

void testcollisions()
{
  int i;

  clrscr();
  textattr(BACKGROUND+MENUITEM);
  gotoxy((78-24)/2,3);
  cputs("Test keyboard collisions");
  gotoxy((78-61)/2,5);
  cputs("Here you can test, if the keys you've choosen do not collide.");
  gotoxy((78-43)/2,6);
  cputs("(only few keyboards allow all combinations)");
  gotoxy((78-18)/2,8);
  cputs("Press ESC to exit.");
  for (i=0;i<256;i++) pressed[i]=0;
  key_init();
  do{
    showjoy(17,12,0);
    showjoy(29,12,1);
    showjoy(41,12,2);
    showjoy(53,12,3);
    while (hi==lo);
    pressed[buffer[lo]&0xff]=buffer[lo]<0x100;
    lo++;
    if (lo==100) lo=0;
  }while(!pressed[1]);
  /*wait until ESC is depressed*/
  do{
    while (hi==lo);
    pressed[buffer[lo]&0xff]=buffer[lo]<0x100;
    lo++;
    if (lo==100) lo=0;
  }while(pressed[1]);
  key_done();
}
开发者ID:OpenEmu,项目名称:Atari800-Core,代码行数:35,代码来源:joycfg.c


示例5: renderMenu

void renderMenu(uint8_t current) {
    uint8_t idx = 0;

    textcolor(1);
    revers(1);
    gotoxy(0, 0);
    for (idx = 0;  idx < menuSize;  idx++) {
        if (idx == current) {
            textcolor(3);
            cputs(menu[idx]);
            
            /*****************/
            cputsxy(0, 1, "\xf0\xc0\xc0\xc0\xc0\xee");
            gotoxy(0, 2);
            cprintf("\xdd%s\xdd", fileMenu[0]);
            gotoxy(0, 3);
            cprintf("\xdd%s\xdd", fileMenu[1]);
            gotoxy(0, 4);
            cprintf("\xdd%s\xdd", fileMenu[2]);
            gotoxy(0, 5);
            cprintf("\xdd%s\xdd", fileMenu[3]);
            cputsxy(0, 6, "\xed\xc0\xc0\xc0\xc0\xfd");
            /*****************/
            
        } else {
            cputs(menu[idx]);
        }
        textcolor(1);
        cputs("  ");
    }
    for (idx = wherex();  idx < 40;  idx++) {
        cputc(' ');
    }
}
开发者ID:afester,项目名称:CodeSamples,代码行数:34,代码来源:main.c


示例6: cputs

char *interactively_read_line(const char *prompt)
{
    const char DELETE = '\x7f';
    const char BACKSPACE = '\x08';
    bool line_is_complete = false;
    char c;
    size_t count = 0;

    cputs(prompt);

    while (! line_is_complete) {
        c = interactively_read_char();
        if (count > 0 && (c == DELETE || c == BACKSPACE)) {
            erase_backward(1);
            count--;
        }
        else if (c == '\r') {
            line[count] = '\0';
            line_is_complete = true;
        }
        else if (count < LINE_CAPACITY - 1) {
            cputc(c);
            line[count++] = c;
        }
        else {
            line[count] = '\0';
            line_is_complete = true;
        }
    }
    cputs("\r\n");
    return line;
}
开发者ID:gungwald,项目名称:posix-6502,代码行数:32,代码来源:more.c


示例7: mainmenu

void mainmenu(int sel)
{
  int i;

  textattr(0x90);
  window(1,1,80,25);
  clrscr();
  textattr(BORDER);
  gotoxy(M_LX,M_UY);
  cputs("Ú");
  for (i = 1; i < (M_WIDTH-1); i++)
    cputs("Ä");
  cputs("¿");
  gotoxy(M_LX,M_UY+1);
  cputs("³                  ³");
  textattr(BANNER);
  gotoxy(M_LX+2,M_UY+1);
  cputs("   Main menu");
  textattr(BORDER);
  gotoxy(M_LX,M_UY+2);
  cputs("ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´");
  for (i = 3; i < (menu_count + M_HEIGHT-1); i++) {
    gotoxy(M_LX,M_UY+i);
    cputs("³                  ³");
  }
  gotoxy(M_LX,M_UY+i);
  cputs("À");
  for (i = 1; i < (M_WIDTH-1); i++)
    cputs("Ä");
  cputs("Ù");
  draw_items(menu_items,menu_count,M_LX+1,M_UY+3,sel);
}
开发者ID:vbmacher,项目名称:qsOS,代码行数:32,代码来源:graph.c


示例8: clear_line

//--------------------------------------------------------------
void clear_line()                    //clear to end of line
   {                                 //80 spaces
   //.....1234567890123456789012345678901234567890
   //.....0........1.........2.........3.........4 
   cputs("                                        ");
   cputs("                                        ");
   }
开发者ID:cjsanjay,项目名称:practise-codes,代码行数:8,代码来源:msoftcon.cpp


示例9: dbg_printmem

void dbg_printmem(void)
{ static unsigned nearLast = 0;
  static unsigned long farLast = 0;

  unsigned nearThis;
  unsigned long farThis;

  switch(heapcheck()) {
  case _HEAPCORRUPT:
    cputs("HEAP CORRUPTED. Cannot proceed!\r\n");
    abort();
  case _HEAPEMPTY:
    cputs("NO HEAP. Cannot proceed!\r\n");
    abort();
  default:
    cputs("Unknown heapcheck() error. Cannot proceed!\r\n");
    abort();
  case _HEAPOK:
    break;
  }

  nearThis = coreleft();
  farThis = farcoreleft();

  dprintf(("[free memory: near=%6u far=%13lu]\n", nearThis, farThis));
  if(nearLast)
    dprintf(("[changed    : near=%6d far=%13ld]\n"
     , nearThis - nearLast , farThis - farLast));

  nearLast = nearThis;
  farLast = farThis;
}
开发者ID:TijmenW,项目名称:FreeDOS,代码行数:32,代码来源:debug.c


示例10: main

int 
main(int argc, 
     char **argv) 
{
  MotorPair m(Motor::A, Motor::C);

  for (int i = 0; i < 10 && !shutdown_requested(); ++i) {
    if (i % 2) {
      m.forward();
#ifdef CONF_DSOUND
      Sound::beep();
#endif // CONF_DSOUND
      cputs ("FWD");
    } else {
      m.reverse();
      cputs ("REV");
    }
    m.speed(m.max);
    sleep(5);
  }
  m.off();
  cls();
  
  return 0;
}
开发者ID:abbrev,项目名称:xs,代码行数:25,代码来源:rover.C


示例11: enter

/************************ ВВОД В ФАЙЛ *********************************/
void enter(void)
{
 instr com;
 FILE *f;
 int i,numm;
 char filename[14],k;

 window(1,1,80,25);
 textbackground(0);
 textcolor(3);
 clrscr();
 cputs("Введите название файла, в который будете делать запись...");
 gets(filename);
 cputs("Сколько будем делать записей...");
 scanf("%d",&numm);
 gets(com.name);
 for (i=0;i<numm;i++)
  {
   clrscr();
   printf("Запись номер %d\n",i);
   cputs("  Введите мнемокод команды...");
   gets(com.name);
   cputs("  Введите длину команды...");
   gets(com.size);
   cputs("  Введите шестнадцатиричный код команды...");
   gets(com.hex);
   if(access(filename,06)==-1)
     f=fopen(filename,"aw");
    else
     f=fopen(filename,"ar");
   fseek(f,0,SEEK_END);
   fwrite(&com,sizeof(com),1,f);
   fclose(f);
   }
}
开发者ID:majioa,项目名称:majioa-master-deg-n-thesis,代码行数:36,代码来源:SKRYLEV.C


示例12: _setcursortype

void funccall::colbox()
{
	int i;
	for(i=1;i<6;++i)
	{
		_setcursortype(_NOCURSOR);
		textbackground(BLACK);
		textcolor(i);
		clrscr();
		box(77,23,2,2);
		delay(500);
		box(73,19,4,4);
		delay(500);
		box(69,15,6,6);
		delay(500);
		box(65,11,8,8);
		delay(500);
		textcolor(WHITE);
		gotoxy(10,10);
		cputs("CREEPER");
		gotoxy(64,10);
		cputs("CREEPER");
		gotoxy(10,16);
		cputs("CREEPER");
		gotoxy(64,16);
		cputs("CREEPER");
		gotoxy(36,13);
		cputs("CREEPER");
		delay(1000);
	}
}
开发者ID:contactsakshamgupta,项目名称:creeper,代码行数:31,代码来源:MAIN.CPP


示例13: test_cheap

void test_cheap(void) {
    cputs("C heap tests:\r\n");
    test_cheap_push();
    test_cheap_pop();
    test_cheap_sort();
    //test_cheap_benchmark();
    cputs("\r\n");
}
开发者ID:MagerValp,项目名称:AsmHeap,代码行数:8,代码来源:test_cheap.c


示例14: suppl_log_exit

void suppl_log_exit(suppl_log_csptr_t loginfo)
{	if(loginfo) {
		cputs("\r\n");
		cputs(loginfo);
		cputs("\r\n");
	}
	exit(DBG_EXIT_CODE);
}
开发者ID:ErisBlastar,项目名称:osfree,代码行数:8,代码来源:dbgf_ex2.c


示例15: main

void main()
{
 int x,x2=1,y;
 for(int j=0,k=0; j<46;j++)
 {
   if(j%6==0) k++;
	y=0;x=x2++;
 for(int i=0;i<40;i++)
 {

 	if(i<8)
   	y++;
   else if(i<16)
   	y--;
   else if(i<24)
   	y++;
   else if(i<32)
   	y--;
   else if(i<40)
   	y++;
  /*  else if(i<48)
   	y--;
   else if(i<56)
   	y++;
  else if(i<64)
   	y--;
   else if(i<72)
   	y++;
   else if(i<80)
		y--;
   else if(i<88)
   	y++;
   else if(i<96)
   	y--;
   else if(i<104)
   	y++;
   else if(i<112)
   	y--;         */

   Sleep(3);
   x=x+3;
   if(j%2==0)
   {
   gotoxy(x,y+15);
   cputs("* * *");
   }

   else
   {
   gotoxy(x,y+15);
   cputs("     ");
   }

   }
}
getch();

}
开发者ID:vigzmv,项目名称:Tours-and-Travels,代码行数:58,代码来源:sinewave.cpp


示例16: sel_item

// funkcia oznaci danu funkciu
void sel_item(int sel, int old_sel)
{
  gotoxy(M_LX+1, M_UY+3+old_sel);
  textattr(NOR_ITEM);
  cputs(menu_items[old_sel]);
  gotoxy(M_LX+1, M_UY+3+sel);
  textattr(SEL_ITEM);
  cputs(menu_items[sel]);
}
开发者ID:vbmacher,项目名称:qsOS,代码行数:10,代码来源:graph.c


示例17: con_puts

 void con_puts( const char *s )
 {
   #ifdef _TARGET_GO32_
   VString str = s;
   str_replace( str, "\n", "\r\n" );
   cputs( str );
   #else
   cputs( s );
   #endif
 }
开发者ID:bbonev,项目名称:vslib,代码行数:10,代码来源:unicon.cpp


示例18: myexit

void myexit()
{
  system("del *.dbf");
  clrscr();
  textcolor(BLUE);
  cputs("Abhay Rana");NL cputs("XII-Sc");NL cputs("Templeton College");
  textcolor(WHITE);
  NL NL cputs("Thanks to all those who helped me complete the project in time. Your names do appear in the program"); NL cputs("S‚ Onr Sv‚rdar Sitja Hvass");
  GC
}
开发者ID:captn3m0,项目名称:hacker,代码行数:10,代码来源:HACKER.CPP


示例19: main

void main()
{
    clrscr();
    cputs(get_machine_hardware_name());
    cputc(' ');
    cputs(get_cpu_name());
    cputs("\r\n");

    getchar();
}
开发者ID:gungwald,项目名称:posix-6502,代码行数:10,代码来源:uname.c


示例20: main

/*------------------------------------------------------------------------*
 * Simulator main.                                                        *
 *------------------------------------------------------------------------*/
int main(void) {
  EventListener sd1fel, sd2fel, tel;

  /*
   * System initializations.
   * - HAL initialization, this also initializes the configured device drivers
   *   and performs the board-specific initializations.
   * - Kernel initialization, the main() function becomes a thread and the
   *   RTOS is active.
   */
  halInit();
  chSysInit();

  /*
   * Serial ports (simulated) initialization.
   */
  sdStart(&SD1, NULL);
  sdStart(&SD2, NULL);

  /*
   * Shell manager initialization.
   */
  shellInit();
  chEvtRegister(&shell_terminated, &tel, 0);

  /*
   * Console thread started.
   */
  cdtp = chThdCreateFromHeap(NULL, CONSOLE_WA_SIZE, NORMALPRIO + 1,
                             console_thread, NULL);

  /*
   * Initializing connection/disconnection events.
   */
  cputs("Shell service started on SD1, SD2");
  cputs("  - Listening for connections on SD1");
  (void) chIOGetAndClearFlags(&SD1);
  chEvtRegister(chIOGetEventSource(&SD1), &sd1fel, 1);
  cputs("  - Listening for connections on SD2");
  (void) chIOGetAndClearFlags(&SD2);
  chEvtRegister(chIOGetEventSource(&SD2), &sd2fel, 2);

  /*
   * Events servicing loop.
   */
  while (!chThdShouldTerminate())
    chEvtDispatch(fhandlers, chEvtWaitOne(ALL_EVENTS));

  /*
   * Clean simulator exit.
   */
  chEvtUnregister(chIOGetEventSource(&SD1), &sd1fel);
  chEvtUnregister(chIOGetEventSource(&SD2), &sd2fel);
  return 0;
}
开发者ID:Amirelecom,项目名称:brush-v1,代码行数:58,代码来源:main.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ cpv函数代码示例发布时间:2022-05-30
下一篇:
C++ cputime_sub函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap