本文整理汇总了C++中putch函数的典型用法代码示例。如果您正苦于以下问题:C++ putch函数的具体用法?C++ putch怎么用?C++ putch使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了putch函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: draw_circle
//--------------------------------------------------------------
void draw_circle(int xC, int yC, int radius)
{
double theta, increment, xF, pi=3.14159;
int x, xN, yN;
increment = 0.8 / static_cast<double>(radius);
for(theta=0; theta<=pi/2; theta+=increment) //quarter circle
{
xF = radius * cos(theta);
xN = static_cast<int>(xF * 2 / 1); //pixels not square
yN = static_cast<int>(radius * sin(theta) + 0.5);
x = xC-xN;
while(x <= xC+xN) //fill two horizontal lines
{ //one for each half circle
set_cursor_pos(x, yC-yN); putch(fill_char); //top
set_cursor_pos(x++, yC+yN); putch(fill_char); //bottom
}
} //end for
}
开发者ID:cjsanjay,项目名称:practise-codes,代码行数:20,代码来源:msoftcon.cpp
示例2: putstr
void putstr(const char *str)
{
int i;
if (!str)
return;
i = 0;
while (str[i]) {
putch(str[i++]);
}
}
开发者ID:Ted-Chang,项目名称:matrix,代码行数:10,代码来源:util.c
示例3: worm_draw
void
worm_draw(worm_t *worm)
{
int w;
for (w = 0; w < worm->nsegs; w++) {
position(worm->row[w], worm->col[w]);
putch('*');
}
}
开发者ID:yaqingwang,项目名称:nachos,代码行数:10,代码来源:snake.c
示例4: plodput
int
plodput(int c)
{
if (plodflg) {
plodcnt--;
return 0;
} else
return putch(c);
}
开发者ID:n-t-roff,项目名称:ex-3.7,代码行数:10,代码来源:ex_put.c
示例5: flush_delay_buf
static
void
flush_delay_buf(void)
{
size_t i;
for (i=0; i<delayed_outbuf_pos; i++) {
putch(delayed_outbuf[i]);
}
delayed_outbuf_pos = 0;
}
开发者ID:ChunHungLiu,项目名称:pikachuos,代码行数:10,代码来源:console.c
示例6: puts
void puts(char *text)
/// Output a string to the screen
{
int i;
for (i = 0; i < strlen(text); i++) // Repeat until null charecter
{
putch(text[i]); // Put a charecter on the screen
}
}
开发者ID:dxywx,项目名称:ScorchOS,代码行数:10,代码来源:scrn.c
示例7: putHexNibble
void putHexNibble(unsigned char value)
{
value &= 0xf;
if(value > 9)
value += 'A' - 10;
else
value += '0';
putch(value);
}
开发者ID:LestherSK,项目名称:GCrash,代码行数:10,代码来源:GCrash.c
示例8: readstring
void readstring(char *buf)
{
while (*(buf-1) != 13)
{
*(buf++) = toupper(getch());
putch(*(buf-1));
if (*(buf-1) == 8) buf -= 2;
}
*(buf-1) = 0;
}
开发者ID:tridge,项目名称:junkcode,代码行数:10,代码来源:prods2.c
示例9: rtp_term_putc
/*----------------------------------------------------------------------*
rtp_term_putc
*----------------------------------------------------------------------*/
void rtp_term_putc (char ch)
{
// Do ASCII translation. Make sure that \n gets translated to \r\n.
if (ch == '\n')
{
rtp_term_putc('\r');
}
putch(ch);
}
开发者ID:maojxsir,项目名称:upnp,代码行数:13,代码来源:rtpterm.c
示例10: vfs_console_write
ssize_t vfs_console_write(struct vfs_file_s *file, const void *src, size_t len)
{
if (stdout_hook)
stdout_hook(src, len);
size_t i;
for (i = 0; i < len; ++i)
putch(((const char*)src)[i]);
return len;
}
开发者ID:apmorton,项目名称:libxenon,代码行数:10,代码来源:newlib.c
示例11: puts
void puts(char *str) {
pt_s = 1;
int length = str_len(str);
int i =0;
while(i < length) {
putch(str[i]);
i++;
}
pt_s = 0;
}
开发者ID:kookerus,项目名称:ASH-OS,代码行数:10,代码来源:system.c
示例12: plodput
int
plodput(int c)
{
if (plodflg)
plodcnt--;
else
putch(c);
return c;
}
开发者ID:chungy,项目名称:ex-vi,代码行数:10,代码来源:ex_put.c
示例13: read_pass
uint8_t read_pass()
{
for(uint8_t inchar = getch(); inchar != 0 && inchar != 0xa && inchar != 0xd; inchar = getch())
{
#if PASS_VULN_TRIVIAL
if (n_received >= passwlen || inchar != password[n_received])
{
putch(n_received);
putch(inchar);
putch(password[n_received]);
return 1;
}
n_received++;
#else
received[n_received++] = inchar;
#endif
}
return 0;
}
开发者ID:microcontroller,项目名称:cwl-projects,代码行数:19,代码来源:passcheck.c
示例14: caml_ml_output_char
CAMLprim value caml_ml_output_char(value vchannel, value ch)
{
CAMLparam2 (vchannel, ch);
struct channel * channel = Channel(vchannel);
Lock(channel);
putch(channel, Long_val(ch));
Unlock(channel);
CAMLreturn (Val_unit);
}
开发者ID:joechenq,项目名称:multi-script,代码行数:10,代码来源:ocaml_io.c
示例15: textlineh
void textlineh(int row, int start, int finish)
{
int count;
for(count = start; count <= finish; count++)
{
gotoxy(count,row);
putch(HLINE);
}
}
开发者ID:tridge,项目名称:junkcode,代码行数:10,代码来源:optcolor.c
示例16: getche
char *Sys_ConsoleInput(void)
{
static char text[256];
static int len = 0;
char ch;
if (!isDedicated)
return NULL;
if (! kbhit())
return NULL;
ch = getche();
switch (ch)
{
case '\r':
putch('\n');
if (len)
{
text[len] = 0;
len = 0;
return text;
}
break;
case '\b':
putch(' ');
if (len)
{
len--;
putch('\b');
}
break;
default:
text[len] = ch;
len = (len + 1) & 0xff;
break;
}
return NULL;
}
开发者ID:ACIIL,项目名称:Quake,代码行数:43,代码来源:sys_dos.c
示例17: flush_console
static void flush_console()
{
char * p=text;
while(*p){
putch(*p);
console_putch(*p++);
}
text[0]='\0';
}
开发者ID:Cancerous,项目名称:libxenon,代码行数:10,代码来源:c_except.c
示例18: PMU_ISR
/* PMU interrupt service routine */
void PMU_ISR(void)
{
#ifdef DEBUG
putch('I');
#endif
/* send msg to main loop */
Task_Push(MSG_ID_PMU_IND, 0, 0);
INTF = 0;
}
开发者ID:robbie-cao,项目名称:wmd,代码行数:11,代码来源:pmu.c
示例19: outCon
/* -------------------------------------------------------------------- */
void outCon(char c)
{
unsigned char row, col;
static char escape = FALSE;
if (!console)
return;
if (c == '\a' /* BELL */ && cfg.noBells)
return;
if (c == 27 || escape) { /* ESC || ANSI sequence */
escape = ansi(c);
return;
}
if (c == 0x1a) /* CT-Z */
return;
if (!anyEcho)
return;
/* if we dont have carrier then count what goes to console */
if (!gotCarrier())
transmitted++;
if (c == '\n')
doccr();
else if (c == '\r') {
putch(c);
} else {
readpos(&row, &col);
if (c == '\b' || c == 7) {
if (c == '\b' && col == 0 && prevChar != '\n')
position(row - 1, 80);
putch(c);
} else {
(*charattr) (c, ansiattr);
if (col == 79) {
position(row, col);
doccr();
}
}
}
}
开发者ID:dylancarlson,项目名称:fredcit,代码行数:44,代码来源:MODEM.C
示例20: RingBell
void
RingBell(void)
{
#ifdef UNIX
refresh();
beep();
#else
putch('\a');
#endif
}
开发者ID:base698,项目名称:ProQCC,代码行数:10,代码来源:screen.c
注:本文中的putch函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论