当前位置: 首页>>代码示例>>C++>>正文


C++ cputs函数代码示例

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


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


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