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

C++ PutCh函数代码示例

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

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



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

示例1: GetCh

void THtmlLx::GetEscCh(){
  GetCh();
  EscCh=(Ch=='&');
  if (EscCh){
    EscChA.Clr(); EscChA.AddCh(Ch); GetCh();
    if (Ch=='#'){
      EscChA.AddCh(Ch); GetCh();
      if (('0'<=Ch)&&(Ch<='9')){
        do {EscChA.AddCh(Ch); GetCh();} while (('0'<=Ch)&&(Ch<='9'));
        if (Ch==';'){GetCh();}
        PutStr(ChDef.GetEscStr(EscChA));
      } else {
        PutCh('#'); PutCh('&');
      }
    } else
    if (('a'<=Ch)&&(Ch<='z')||('A'<=Ch)&&(Ch<='Z')){
      do {
        EscChA.AddCh(Ch); GetCh();
      } while (('A'<=Ch)&&(Ch<='Z')||('a'<=Ch)&&(Ch<='z')||('0'<=Ch)&&(Ch<='9'));
      if (Ch==';'){GetCh();}
      PutStr(ChDef.GetEscStr(EscChA));
    } else {
      PutCh('&');
    }
  }
}
开发者ID:pikma,项目名称:Snap,代码行数:26,代码来源:html.cpp


示例2: WriteField

static void WriteField(CARDINAL position, BOOLEAN allowSpace, 
                       CARDINAL *i)
{
  CARDINAL spaces;
  BOOLEAN  quoted = FALSE;
  /*Get to right position*/
  Tab(position);
  while ((!quoted && (!TermCheck(currentLinePointer[*i]) ||
    (allowSpace && (currentLinePointer[*i] == Space)))) ||
    (quoted && (currentLinePointer[*i] != CR))) {
    if (currentLinePointer[*i] == Space) {
      spaces = 0;
      while (currentLinePointer[*i + spaces] == Space) spaces++;

      if ((currentLinePointer[*i + spaces] == CR) || (!quoted && (currentLinePointer[*i + spaces] == CommentSymbol)))
       {
        i += spaces;
        return;
      }; /* if */
      do PutCh(currentLinePointer[(*i)++]);
      while (currentLinePointer[*i] == Space);
    } else {
      PutCh(currentLinePointer[*i]);
      if (currentLinePointer[*i] == Quotes) quoted = !quoted;
      (*i)++;
    }; /* if */
  }; /* while */
  while (currentLinePointer[*i] == Space) (*i)++;
} /* End WriteField */
开发者ID:axelmuhr,项目名称:Helios-NG,代码行数:29,代码来源:listing.c


示例3: lib_int_RawDoFmtNumber

static void lib_int_RawDoFmtNumber(UINT32 ul, int base, void (*PutCh)(INT32, APTR), APTR PutChData, int pad0flag, int width)
{
	// hold a long in base 2
	char *p, buf[(sizeof(long) * 8) + 1];
	int i;

	p = buf;

	do {
		*p++ = "0123456789abcdef"[ul % base];
	} while (ul /= base);

	if(p-buf < width)
	{
		if(pad0flag == 1)
		{
			for(i=0; i < width - (p-buf); i++)
				PutCh('0', PutChData);
		}
		else
		{
			for(i=0; i < width - (p-buf); i++)
				PutCh(' ', PutChData);
		}

	}

	do {
		PutCh(*--p, PutChData);
	} while (p > buf);
}
开发者ID:cycl0ne,项目名称:poweros_x86,代码行数:31,代码来源:rawdoformat.c


示例4: PutSep

int TSOut::PutSep(const int& NextStrLen){
  int Cs=0;
  if (MxLnLen==-1){
    Cs+=PutCh(' ');
  } else {
    if (LnLen>0){
      if (LnLen+1+NextStrLen>MxLnLen){Cs+=PutLn();} else {Cs+=PutCh(' ');}
    }
  }
  return Cs;
}
开发者ID:andrejmuhic,项目名称:qminer,代码行数:11,代码来源:fl.cpp


示例5: ListRegValue

void ListRegValue(CARDINAL reg)
{
  if (((1 << ListPC) & listStatus) && printState) {
    PutChs("       ");
    PutHexCh(reg);
    PutCh(Space);
  }; /* if */
} /* End ListRegValue */
开发者ID:axelmuhr,项目名称:Helios-NG,代码行数:8,代码来源:listing.c


示例6: ListWordValue

void ListWordValue(CARDINAL w)
{
  if (printState && ((1 << ListPC) & listStatus)) {
    if (linePosition >= TextStart) PutLine();
    Tab(CodeStart);
    PutHexCardinal(w);
    PutCh(Space);
  }; /* if */
} /* End ListWordValue */
开发者ID:axelmuhr,项目名称:Helios-NG,代码行数:9,代码来源:listing.c


示例7: PutStrPgm

void PutStrPgm(PGM_P str)
{
	char ch;
	do {
		ch=pgm_read_byte(str++);
		if(ch)
			PutCh(ch);
	}while(ch);
}
开发者ID:andrewhannay,项目名称:FIGnition,代码行数:9,代码来源:LLDebug.c


示例8: GetB

void GetB(char buf[BUF_MAX])
{	
	int i = 0;

	while (i < BUF_MAX)
	{
		buf[i] = GetCh();
		PutCh(buf[i]);
		i++;
		if (buf[i-1] == CR)
		{
			buf[i] = '\0';
			break;
		}
	}	
	PutCh(CR);
	PutCh(LF);
	return;
}
开发者ID:seungwoonlee,项目名称:dream,代码行数:19,代码来源:Calculator.cpp


示例9: EscapeWriteCh

/* GSTrans character output */
static void EscapeWriteCh(char ch)
{
 if ((ch >= Space) && (ch < Del))
  PutCh(ch) ;
 else
  if (ch == Del)
   PutChs("|?") ;
  else
   if (ch > Del)
    {
     PutChs("|!") ;
     EscapeWriteCh(ch - 0x80) ;
    }
   else
    {
     PutCh('|') ;
     PutCh(ch + 0x40) ;
    }
} /* End EscapeWriteCh */
开发者ID:axelmuhr,项目名称:Helios-NG,代码行数:20,代码来源:listing.c


示例10: ListByteValue

void ListByteValue(char b)
{
  if (printState && ((1 << ListPC) & listStatus)) {
    if (linePosition >= TextStart) PutLine();
    Tab(CodeStart);
    PutHexCh(b / 0x10);
    PutHexCh(b % 0x10);
    PutCh(Space);
  }; /* if */
} /* End ListByteValue */
开发者ID:axelmuhr,项目名称:Helios-NG,代码行数:10,代码来源:listing.c


示例11: PutBf

int TMOut::PutBf(const void* LBf, const int& LBfL){
  int LBfS=0;
  if (BfL+LBfL>MxBfL){
    for (int LBfC=0; LBfC<LBfL; LBfC++){
      LBfS+=PutCh(((char*)LBf)[LBfC]);}
  } else {
    for (int LBfC=0; LBfC<LBfL; LBfC++){
      LBfS+=(Bf[BfL++]=((char*)LBf)[LBfC]);}
  }
  return LBfS;
}
开发者ID:Accio,项目名称:snap,代码行数:11,代码来源:flx.cpp


示例12: PutLine

void PutLine(void)
{
  CARDINAL i;
  if (linePosition != 0) {
    PutCh(CR);
    newLine[linePosition] = 0;
    i = 0;
    while (newLine[i] != 0) WriteCh(newLine[i++]);
    linePosition = 0;
  }; /* if */
} /* End PutLine */
开发者ID:axelmuhr,项目名称:Helios-NG,代码行数:11,代码来源:listing.c


示例13: GetCh

bool THttpLx::IsLws(){
  if ((Ch==' ')||(Ch==TCh::TabCh)){
    return true;
  } else
  if (Ch==TCh::CrCh){
    GetCh();
    if (Ch==TCh::LfCh){
      GetCh(); bool Ok=(Ch==' ')||(Ch==TCh::TabCh);
      PutCh(TCh::LfCh); PutCh(TCh::CrCh); return Ok;
    } else {
      PutCh(TCh::CrCh); return false;
    }
  } else
  if (Ch==TCh::LfCh){
    GetCh(); bool Ok=(Ch==' ')||(Ch==TCh::TabCh);
    PutCh(TCh::LfCh); return Ok;
  } else {
    return false;
  }
}
开发者ID:AlertProject,项目名称:Text-processing-bundle,代码行数:20,代码来源:http.cpp


示例14: PutBf

int TMOut::PutBf(const void* LBf, const TSize& LBfL){
  int LBfS=0;
  if (TSize(BfL+LBfL)>TSize(MxBfL)){
    for (TSize LBfC=0; LBfC<LBfL; LBfC++){
      LBfS+=PutCh(((char*)LBf)[LBfC]);}
  } else {
    for (TSize LBfC=0; LBfC<LBfL; LBfC++){
      LBfS+=(Bf[BfL++]=((char*)LBf)[LBfC]);}
  }
  return LBfS;
}
开发者ID:andrejmuhic,项目名称:qminer,代码行数:11,代码来源:fl.cpp


示例15: WriteComment

static void WriteComment(CARDINAL *i)
{
  CARDINAL tempPosition,
           length;
  if (currentLinePointer[*i] != CommentSymbol)
   {

    /*This is the silly line format case*/
    while (currentLinePointer[*i] != CR) PutCh(currentLinePointer[(*i)++]);
    PutLine();
  } else {
    if (linePosition <= TextStart) tempPosition = TextStart;
    else {
      tempPosition = CommentStart;
      PutCh(Space);
    }; /* if */
    Tab(tempPosition);
    if (linePosition > CommentStart) {
      length = 0;
      while (currentLinePointer[*i + length] != CR) length++;
      if ((linePosition + length > maxCols) &&
        (tempPosition + length <= maxCols)) {
        PutLine();
        Tab(CommentStart);
      }; /* if */
    }; /* if */
    do {
      while (linePosition < maxCols) {
        if (currentLinePointer[*i] == CR) break;
        PutCh(currentLinePointer[(*i)++]);
      }; /* while */
      if (linePosition < maxCols) break;
        /* The previous break was meant to leave the loop */
      PutLine();
      Tab(tempPosition);
    } while (1);
  }; /* if */
} /* End WriteComment */
开发者ID:axelmuhr,项目名称:Helios-NG,代码行数:38,代码来源:listing.c


示例16: GetS

int GetS(char* buf)
{
	int i = 0;

	while (i < MAX_BUF)
	{
		buf[i]  = GetCh();
		if (!( zIsAlnum(buf[i]) || buf[i] == ENTER || buf[i] == BACKSPACE || buf[i] == '+' || buf[i] == '-' || buf[i] == '*' || buf[i] == '/' || buf[i] == '%' || buf[i] == '(' || buf[i] == ')' || buf[i] == '=' ))
		{
			continue;
		}		
		PutCh(buf[i]);
		buf[i] = zToLower(buf[i]);	// 대문자가 입력되면 소문자로 변환해버려라
		i++;
		if (buf[i-1] == CR)	// 엔터가 입력되면 마지막에 NULL을 추가하고 멈춘다.
		{
			buf[i] = '\0';
			break;
		}
	}
	PutCh(CR);
	PutCh(LF);
	return i;
}
开发者ID:seungwoonlee,项目名称:dream,代码行数:24,代码来源:Calculator2.cpp


示例17: PrintLineNumber

void PrintLineNumber(void)
{
  char     digits[7];
  int      i;
  CARDINAL j;
  BOOLEAN  suppress = FALSE;
  j = lineNumber;
  for (i = 5; i >= 0; i--) {
    digits[i] = (suppress) ? Space : '0' + (j % 10);
    j = j / 10;
    suppress = j == 0;
  }; /* for */
  if (linePosition > 0) PutLine();
  digits[6] = 0;
  PutChs(digits);
  PutCh(Space);
} /* End PrintLineNumber */
开发者ID:axelmuhr,项目名称:Helios-NG,代码行数:17,代码来源:listing.c


示例18: TestChA

bool THttpLx::IsRespStatusLn(){
  static const TChA MouldChA="http/N.N NNN ";
  TChA TestChA(MouldChA);
  int TestLen=TestChA.Len();
  if (1+Len()<TestLen){return false;}
  TestChA.PutCh(0, ChDef.GetLcCh(Ch));
  {for (int ChN=1; ChN<TestLen; ChN++){
    TestChA.PutCh(ChN, ChDef.GetLcCh(GetCh()));}}
  {for (int ChN=1; ChN<TestLen; ChN++){
    PutCh(TestChA[TestLen-ChN-1]);}}
  {for (int ChN=0; ChN<MouldChA.Len(); ChN++){
    if (MouldChA[ChN]=='N'){
      if (!ChDef.IsDigit(TestChA[ChN])){return false;}
    } else {
      if (MouldChA[ChN]!=TestChA[ChN]){return false;}
    }
  }}
  return true;
}
开发者ID:AlertProject,项目名称:Text-processing-bundle,代码行数:19,代码来源:http.cpp


示例19: PrintLine

void PrintLine(void)
{
  CARDINAL i = 0;
  if (!linePrinted) {
    if (TextStart >= maxCols) {
      /*This is the silly line format case*/
      if (linePosition > TextStart) PutLine();
      else Tab(TextStart);
      while (currentLinePointer[i] != CR) PutCh(currentLinePointer[i++]);
    } else {
      /*This is the sensible case*/
      if ((linePosition > TextStart) && (currentLinePointer[i] != Space))
        PutLine();
      do {

        if ((currentLinePointer[i] == CommentSymbol) || (OpcodeStart >= maxCols))
         break;
        /*Write out the label*/
        WriteField(TextStart, FALSE, &i);

        if ((currentLinePointer[i] == CR) || (currentLinePointer[i] == CommentSymbol) || (OperandStart >= maxCols))
         break ;

        /*We have an opcode*/
        if (linePosition >= OpcodeStart) PutLine();
        WriteField(OpcodeStart, FALSE, &i);

        if ((currentLinePointer[i] == CR) || (currentLinePointer[i] == CommentSymbol) || (CommentStart >= maxCols))
         break ;

        /*We have an operand*/
        if (linePosition >= OperandStart) PutLine();
        WriteField(OperandStart, TRUE, &i);
      } while (1);
      if (currentLinePointer[i] != CR) WriteComment(&i);
    }; /* if */
    PutLine();
  }; /* if */
  linePrinted = TRUE;
  linePosition = 0;
  if (PollEscape()) abortFlag = TRUE;
} /* End PrintLine */
开发者ID:axelmuhr,项目名称:Helios-NG,代码行数:42,代码来源:listing.c


示例20: PutDosLn

int TSOut::PutDosLn(const int& Lns){
  LnLen=0; int Cs=0;
  for (int LnN=0; LnN<Lns; LnN++){Cs+=PutCh(TCh::CrCh)+PutCh(TCh::LfCh);}
  return Cs;
}
开发者ID:andrejmuhic,项目名称:qminer,代码行数:5,代码来源:fl.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ PutChar函数代码示例发布时间:2022-05-30
下一篇:
C++ Put函数代码示例发布时间: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