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

C++ printChar函数代码示例

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

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



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

示例1: printString

void printString(const char *s)
{
    while(*s) {
        printChar(*s);
        s++;
    }
}
开发者ID:cody82,项目名称:cheali-charger-i1,代码行数:7,代码来源:SerialLog.cpp


示例2: displayDebugStack

/**
 * Display the debugging messages in the ncurses window
 */
void displayDebugStack(const WINDOW* window) {
    if (DEBUG_STACK->head == NULL) {
        return;
    }

    int maxY = 24;
    int maxX = 80;
    getmaxyx(window, maxY, maxX);

    for (int y=1; y <= 3; y++) {
        for (int x=0; x <= maxX; x++) {
            MapCoordinate position = initMapCoordinate(x, y);
            printChar(' ', position, BLACK_ON_WHITE);
        }
    }

    // Print three most recent debug messages
    DebugNode* current = DEBUG_STACK->current;
    if (current != NULL) {
        printDebug(current, 3);
        current = current->previous;
        if (current != NULL) {
            printDebug(current, 2);
            current = current->previous;
            if (current != NULL) {
                printDebug(current, 1);
            }
        }
    }
}
开发者ID:mes32,项目名称:folly,代码行数:33,代码来源:debugfolly.c


示例3: movePlayer

void movePlayer(PLAYER (*ppp)[], int i, int dir) {
	PLAYER *p = &(*ppp)[i];
	POSITION oldPosition = (*p).obj.pos;
	POSITION newPosition = getNewPosition(oldPosition, dir);
	if (isPositionValid(newPosition, dir)) {
		// save move if not yet finished:
		if ((*p).finished != 1) {
			saveMove(p, dir);
		}
		// if player crossed the line, finished flag is set to true:
		if (crossedTheLine(oldPosition, dir)) {
			(*p).finished = 1;
		}
		int symbol = getSymbolOnTheTrack(oldPosition);
		erasePlayer(p); 
		// if player was on the finish line, draw finish line:
		if (symbol == '|') { 
			printChar('|', oldPosition);
		}
		(*p).obj.pos = newPosition;
		// so that if two were on the same spot both get printed:
		printAllPlayers(ppp);
		// so that it if two are on the same spot the last that arrived gets printed:
		printPlayer(p); 
	}
}
开发者ID:gto76,项目名称:race,代码行数:26,代码来源:term.c


示例4: pn

/**
 * Prints an integer value
 * @param input The unsigned value.
 */
void pn(unsigned int input)
{
	int ldb = input % 10;
	int n = (int) input / 10;
	if (input > 9) pn(n);
	printChar(ldb + 48);
}
开发者ID:yannickulrich,项目名称:LionOS.core,代码行数:11,代码来源:screen.c


示例5: if

void TFT_ScaleFonts::rotateChar(byte c, int x, int y, int pos, int S, int deg)
{
  if (S < 1) S = 1;

  if ((S == 1) && (deg == 0))
  {
    _Disp->printChar(c, x, y);
    return;
  }
  else if (S == 1)
  {
    _Disp->rotateChar(c, x, y, pos, deg);
    return;
  }
  else if (deg == 0)
  {
    printChar(c, x, y, S);
    return;
  }

  byte i, j, ch;
  word temp;
  int newx, newy;
  double radian;
  radian = deg * 0.0175;

  cbi(_Disp->P_CS, _Disp->B_CS);

  temp = ((c - _Disp->cfont.offset) * ((_Disp->cfont.x_size / 8) * _Disp->cfont.y_size)) + 4;
  for (j = 0; j < _Disp->cfont.y_size * S; j += S)
  {
    for (int zz = 0; zz < (_Disp->cfont.x_size / 8)*S; zz += S)
    {
      ch = pgm_read_byte(&_Disp->cfont.font[temp + (zz / S)]);
      for (i = 0; i < (8 * S); i++)
      {
        for (int s = 0; s < S; s++)
        {
          newx = x + (((i + (zz * 8) + (pos * _Disp->cfont.x_size)) * cos(radian)) - ((j + s) * sin(radian)));
          newy = y + (((j + s) * cos(radian)) + ((i + (zz * 8) + (pos * _Disp->cfont.x_size)) * sin(radian)));

          _Disp->setXY(newx, newy, newx + 1, newy + 1);

          if ((ch & (1 << (7 - (i / S)))) != 0)
          {
            _Disp->setPixel((_Disp->fch << 8) | _Disp->fcl);
          }
          else
          {
            if (!_Disp->_transparent)
              _Disp->setPixel((_Disp->bch << 8) | _Disp->bcl);
          }
        }
      }
    }
    temp += (_Disp->cfont.x_size / 8);
  }
  sbi(_Disp->P_CS, _Disp->B_CS);
  _Disp->clrXY();
}
开发者ID:AndrewMascolo,项目名称:TFT_ScaleFonts,代码行数:60,代码来源:TFT_ScaleFonts.cpp


示例6: strlen

void TFT_ScaleFonts::print(char *st, int x, int y, int S, int deg)
{
  if (S < 1) S = 1;

  if (S == 1)
  {
    _Disp->print(st, x, y, deg);
    return;
  }

  int stl, i;

  stl = strlen(st);

  if (_Disp->orient == PORTRAIT)
  {
    if (x == RIGHT)
      x = ((Bound_X2 - Bound_X)/*_Disp->disp_x_size*/ + 1) - (stl * _Disp->cfont.x_size * S);
    if (x == CENTER)
      x = (((Bound_X2 - Bound_X) + 1) - (stl * _Disp->cfont.x_size * S)) / 2;
  }
  else
  {
    if (x == RIGHT)
      x = ((Bound_Y2 - Bound_Y) + 1) - (stl * _Disp->cfont.x_size * S);
    if (x == CENTER)
      x = (((Bound_Y2 - Bound_Y) + 1) - (stl * _Disp->cfont.x_size * S)) / 2;
  }

  for (i = 0; i < stl; i++)
    if (deg == 0)
      printChar(*st++, x + (i * (_Disp->cfont.x_size * S)), y, S);
    else
      rotateChar(*st++, x, y, i * S, S, deg);
}
开发者ID:AndrewMascolo,项目名称:TFT_ScaleFonts,代码行数:35,代码来源:TFT_ScaleFonts.cpp


示例7: printCharN

/*! Repeatedly prints a character specified by its ASCII code to the display.
    Most LCDs can also print some special characters, such as those in LCD.h.
    @param data The character to print to the LCD.
    @param times The number of times to print the character.
 */
void printCharN(const u08 data, const u08 times)
{
	for (u08 i = 0; i < times; i++)
	{
		printChar(data);
	}
}
开发者ID:weeatbrains,项目名称:cs596,代码行数:12,代码来源:LCD.c


示例8: sendHeader

void sendHeader(uint16_t channel)
{
//return; //ign

    CRC = 0;
    printChar('$');
    printUInt(channel);
    printD();
    printUInt(Program::programType+1);
    printD();

    printUInt(currentTime/1000);   //timestamp
    printChar('.');
    printUInt((currentTime/100)%10);   //timestamp
    printD();
}
开发者ID:cody82,项目名称:cheali-charger-i1,代码行数:16,代码来源:SerialLog.cpp


示例9: printConstant

static void printConstant( int lev, ASTNode node )
{
	indent( lev );
	switch (node->vConstExpr.type)
	{
	case inumberConst:
		ec_stderr_printf( "<const: %ld>", (long)node->vConstExpr.vInt );
		break;
	case fnumberConst:
		ec_stderr_printf( "<const: %g>", node->vConstExpr.vFloat );
		break;
	case charConst:
		if (isprint( (int) node->vConstExpr.vChar ))
			ec_stderr_printf( "<const: '%c'>", node->vConstExpr.vChar );
		else
		{
			ec_stderr_printf( "<const: '" );
			printChar( node->vConstExpr.vChar );
			ec_stderr_printf( "'>" );
		}
		break;
	case symbolConst:
		ec_stderr_printf( "<const: %s>", EcSymbolAt( node->vConstExpr.vSym ) );
		break;
	case stringConst:
		ec_stderr_printf( "<const: \"" );
		printString( node->vConstExpr.vString );
		ec_stderr_printf( "\">" );
		break;
	case objectConst:
		ec_stderr_printf( "<const: EC_OBJ 0x%08lX>", (unsigned long)node->vConstExpr.vObject );
		break;
	}
}
开发者ID:BackupTheBerlios,项目名称:elastic,代码行数:34,代码来源:ast.c


示例10: printWord

void printWord(int iline , int argc ,char **argv){
	int iarg;
	for(iarg = 1; iarg != argc; ++iarg) {
		char *c = argv[iarg];
		printChar(c,iline);
		printSpace(iarg , iline , argc);
	}
}
开发者ID:NeTTa,项目名称:espl,代码行数:8,代码来源:ascart.c


示例11: printInteger

void printInteger(int X){
  	int Y=getReverse(X);
  	while(Y>0)
	{
  	printChar(48+mod(Y,10));
  	Y=div(Y,10);
 	 }
}
开发者ID:DushyantaDhyani,项目名称:MiniOS,代码行数:8,代码来源:kernel.c


示例12: clearSerial

void MG2639_Cell::sendATCommand(const char * command)
{	
	clearSerial();	// Empty the UART receive buffer
	// Send the command:
	printString("AT"); // Print "AT"
	printString(command); // Print the command
	printChar('\r'); // Print a carriage return to end command
}
开发者ID:elpapais,项目名称:MG2639_Cellular_Shield,代码行数:8,代码来源:SFE_MG2639_CellShield.cpp


示例13: while

void Ticker::printString(const char* st)
// print a zero-terminated string which is stored in RAM
{
	while (*st) {
		printChar(*st);
		st++;
	}
}
开发者ID:fab4U,项目名称:PixBlock,代码行数:8,代码来源:ticker.cpp


示例14: printPlain_u08

//Prints an 8-bit unsigned integer as 1-3 digits (no padding). Example: "7"
void printPlain_u08(u08 number)
{
	//if there is a digit in the tens place
	if (number >= 10)
	{
		//if there is a digit in the hundreds place
		if (number >= 100)
		{
			//print the hundreds digit
			printChar((number / 100) + 48);
		}
		//print the tens digit
		printChar(((number % 100 ) / 10) + 48);
	}
	//always print the ones digit
	printChar((number % 10) + 48);
}
开发者ID:bgomberg,项目名称:TapeBot,代码行数:18,代码来源:display.c


示例15: printString

void printString(View *view, char *string, int size, int x, int y, Color mainColor, Color shadowColor) {
   int i=0;
   for (i=0;i<size;++i) {
      char c = *(string + i);
      int p = x + i*8;
      printChar(view, c, p, y, mainColor, shadowColor);
   }
}
开发者ID:shaojianqing,项目名称:SmileOS,代码行数:8,代码来源:charset.c


示例16: printPlain_s16

//Prints a 16-bit signed integer as +/- and 1-5 digits (no padding). Example: "+42"
void printPlain_s16(s16 number)
{
	if (number >= 0)
	{
		//print plus
		printChar('+');
		//cast to print the number as a u16
		printPlain_u16((u16)number);
	}
	else
	{
		//print minus
		printChar('-');
		//make the number positive and print it as a u16
		printPlain_u16((u16)(-number));
	}
}
开发者ID:bgomberg,项目名称:TapeBot,代码行数:18,代码来源:display.c


示例17: printTextP

/*!	\fn 	static void printTextP(const char *data)
*	\brief	Print a string using FLASH stored data
* 
*   \param  data - pointer to flash string
*/
static void printTextP(const char *data)
{
    char c;
    while((c = pgm_read_byte(data++)))
    {
        printChar(c);
    }
}
开发者ID:diyjack,项目名称:mooltipass,代码行数:13,代码来源:aes256_ctr_test.c


示例18: main

int main()
{   
    int i, j, k;
    scanf("%d", &j);
    for(i = 1; i <= j; i++)
    {
          printChar('*', i);
          printf("\n");            
    }
    for (i = j - 1; i > 0; i--)
    {
        printChar('*', i);
        printf("\n");
    }
    system("pause");
    return 0;
}
开发者ID:kathyhuang,项目名称:School,代码行数:17,代码来源:hw5-p2.c


示例19: normalizeAndPrintString

static void normalizeAndPrintString(uchar *s, int len)
{
    int i;

    for(i = 0; i < len; i++) {
        printChar(s[i], (i + 1) >= len);
    }
}
开发者ID:tgfuellner,项目名称:Basteln,代码行数:8,代码来源:avrdebug.c


示例20: printString

void printString( char* str )
{
	while (*str != '\0')
	{
		printChar( *str );
		str++;
	}
}
开发者ID:haggl,项目名称:midiSwitcher,代码行数:8,代码来源:dog.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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