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

C++ PrintInt函数代码示例

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

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



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

示例1: PrintInt

void CCharShape::PrintNode (size_t idx) const {
	TCharNode *node = Nodes[idx];
	PrintInt ("node: ", (int)node->node_name);
	PrintInt ("parent: ", (int)node->parent_name);
	PrintInt ("child: ", (int)node->child_name);
	PrintInt ("next: ", (int)node->next_name);
}
开发者ID:dbluelle,项目名称:pandora-extremetuxracer,代码行数:7,代码来源:tux.cpp


示例2: PrintInt

void CCharShape::PrintNode (int idx) {
	TCharNode *node = Nodes[idx];
	PrintInt ("node: ",node->node_name);
	PrintInt ("parent: ", node->parent_name);
	PrintInt ("child: ", node->child_name);
	PrintInt ("next: ", node->next_name);
}
开发者ID:RKSimon,项目名称:extremetuxracer,代码行数:7,代码来源:tux.cpp


示例3: HTTPPrint_onOffCommand

void HTTPPrint_onOffCommand(void)
{
	int channelNo = GetChannelNumberWithChannelTypeCheck(ONOFF_W_KEY);
	if (!channelNo)
		channelNo = GetChannelNumberWithChannelTypeCheck(ONOFF_W_BUTTON);
	if (!channelNo)
		channelNo = GetChannelNumberWithChannelTypeCheck(ONOFF_COMMAND);
	if (!channelNo)
		channelNo = GetChannelNumberWithChannelTypeCheck(ONOFF_PULSE);
	if (channelNo)
	{
		if (channels[channelNo - 1].channelType == ONOFF_COMMAND || channels[channelNo - 1].channelType == ONOFF_PULSE)
		{
			PrintInt(channels[channelNo -1].channelStatus.onOffCommand.pinCommand);
		}
		else
		{
			PrintInt(channels[channelNo -1].channelStatus.onOff.channelPins.pinCommand);
		}
	}
	else
	{
		TCPPutROMString(sktHTTP, NOT_DEF_STR);
	}
}
开发者ID:openha,项目名称:wifihomeautomation,代码行数:25,代码来源:HTTPApp.c


示例4: DisplayPNames

void DisplayPNames(void)
{
  char Word[15];
  int i,k;
/*  int kk; */
  long l;

  Print(27,22,0,15,SuchStr);
  for (i=0;i<22;i++) {
    if (i>=PNames)
      Print(2,i+2,0,15,"                    ");
    else {
      Entry=E; Entry+=PName[Pos+i].Num;
      if (Entry->Mark==1) k=1; else k=0;
      if (k==0) PrintInt(2,i+2,0,15,Pos+i+1); else PrintInt(2,i+2,HGR,15,Pos+i+1);
      memset(Word,32,15);
      strcpy(Word,Entry->RName);
      Word[strlen(Word)]=32; Word[14]=0;
      if (k==0) Print(7,i+2,0,15,Word); else Print(7,i+2,HGR,15,Word);
      l=Entry->RLength;
      if (k==0) PrintZahl(16,i+2,0,15,l); else PrintZahl(16,i+2,HGR,15,l);
    }
  }
  PrintInt(2,CPos,7,15,Pos+CPos-1);
  Entry=E; Entry+=PName[Pos+CPos-2].Num;
  memset(Word,32,15);
  strcpy(Word,Entry->RName);
  Word[strlen(Word)]=32; Word[14]=0;
  Print(7,CPos,7,15,Word);
  l=Entry->RLength;
  PrintZahl(16,CPos,7,15,l);
  DisplayInfo();
  i=PName[Pos+CPos-2].UsedInTex; if (i<999) Print(55,8,0,7,TEntry[PName[Pos+CPos-2].UsedInTex].TName);
}
开发者ID:fielder,项目名称:NWT,代码行数:34,代码来源:pnames.c


示例5: PrintFP

/* print a double to a stream without using printf/sprintf */
void PrintFP(double Num, struct OutputStream *Stream)
{
    int Exponent = 0;
    int MaxDecimal;
    
    if (Num < 0)
    {
        PrintCh('-', Stream);
        Num = -Num;    
    }
    
    if (Num >= 1e7)
        Exponent = log10(Num);
    else if (Num <= 1e-7 && Num != 0.0)
        Exponent = log10(Num) - 0.999999999;
    
    Num /= pow(10.0, Exponent);    
    PrintInt((long)Num, 0, FALSE, FALSE, Stream);
    PrintCh('.', Stream);
    Num = (Num - (long)Num) * 10;
    if (abs(Num) >= 1e-7)
    {
        for (MaxDecimal = 6; MaxDecimal > 0 && abs(Num) >= 1e-7; Num = (Num - (long)(Num + 1e-7)) * 10, MaxDecimal--)
            PrintCh('0' + (long)(Num + 1e-7), Stream);
    }
    else
        PrintCh('0', Stream);
        
    if (Exponent != 0)
    {
        PrintCh('e', Stream);
        PrintInt(Exponent, 0, FALSE, FALSE, Stream);
    }
}
开发者ID:fjrti,项目名称:remix,代码行数:35,代码来源:clibrary.c


示例6: printf

/*******************************************************************************
* LGScene::writeToFile
*******************************************************************************/
int LGScene::writeToFile (char* cpFilename) {
	FILE* fpFile;		// Output file

	// Open output file
	if (!(fpFile = fopen (cpFilename, "wb"))) {

		// Print error
		printf ("Error opening file: %s", cpFilename);

		// Return error
		return (-1);
	}

	// Print header id
	PrintChunkID (fpFile, "SCN");

	// Print chunk size
	PrintInt (fpFile, LGScene::getChunkSize ());

	// Print number of objects
	PrintInt (fpFile, LGScene::iNrOfObjects);

	// Print objects
	for (int iCount = 0; iCount < LGScene::iNrOfObjects; iCount++) {

		// Write object
		LGScene::opObjects[iCount].write (fpFile);
	}

	// Close file
	fclose (fpFile);

	// Return no error
	return (0);
}
开发者ID:robgietema,项目名称:subzero_editor,代码行数:38,代码来源:lg_scene.cpp


示例7: PrintFloat

void PrintFloat(float val)
{
    //always prints 5 places
    int i = val*100;
    int pflag = 0;
    int thous    = i/10000;
    int hund     = i/1000 - thous*10;
    int tenth    = i/100  - thous*100   - hund*10;
    int dectenth = i/10   - thous*1000  - hund*100  - tenth*10;
    int dechund  = i/1    - thous*10000 - hund*1000 - tenth*100 - dectenth*10;
    if(thous && !pflag){
        PrintInt(thous);
        pflag = 1;
    }
    else{
        PrintString(" ");
    }
    if(hund){
        PrintInt(hund);
        pflag = 1;
    }
    else{
        PrintString(" ");
    }
    PrintInt(tenth);

    PrintString(".");
    PrintInt(dectenth);
    PrintInt(dechund);
}
开发者ID:Kchymet,项目名称:Digistockey,代码行数:30,代码来源:lcd.c


示例8: main

int main()
{
    CyGlobalIntDisable;
    isr_sw_StartEx(SW_Int);

    
    CyGlobalIntEnable;      /* Enable global interrupts */

    UART_1_Start();
    Timer_1_Start();
    Timer_2_Start();
    
    
    for(;;)
    {

      if(press == 2){
            
                        
            time_s = abs(seconds_new - seconds_old)/1000;
            time_ms = (ms_old + 24000 - ms_new);
            
            UART_1_UartPutString("\n \r Time Between Presses: ");
            PrintInt(time_s);
            UART_1_UartPutString(".");
            PrintInt(time_ms);
            UART_1_UartPutString(" s");
            press = 0; 
        }
}
}
开发者ID:eshamidi,项目名称:PSoC2016,代码行数:31,代码来源:main.c


示例9: main

int
main()
{
    int array[SIZE], i, k, sum;
    unsigned start_time, end_time;
    
    start_time = GetTime();
    for (k=0; k<OUTER_BOUND; k++) {
       for (i=0; i<SIZE; i++) sum += array[i];
       PrintInt(k);
    }
    end_time = GetTime();
    PrintChar('\n');
    PrintString("Total sum: ");
    PrintInt(sum);
    PrintChar('\n');
    PrintString("Start time: ");
    PrintInt(start_time);
    PrintString(", End time: ");
    PrintInt(end_time);
    PrintString(", Total time: ");
    PrintInt(end_time-start_time);
    PrintChar('\n');
    return 0;
}
开发者ID:arikj,项目名称:NACHOS,代码行数:25,代码来源:testloop.c


示例10: DisplayFiles

void DisplayFiles(void)
{
  char Word[17];
/*  long l; */
  int i;

  Print(27,22,0,15,SuchStr); Print(18,1,1,1,"     ");

  if (Dateien==0) {
	 for (i=0;i<22;i++) Print(2,i+2,0,15,"                    ");
	 return;
  }

  Datai=Da; Datai+=Pos;
  for (i=0;i<22;i++) {
	 if (i>=Dateien)
		Print(2,i+2,0,15,"                    ");
	 else {
		PrintInt(2,i+2,0,15,Pos+i+1);
		memset(Word,32,16); strcpy(Word,Datai->FileName);
		Word[strlen(Word)]=32; Word[15]=0;
		Print(7,i+2,0,15,Word);
		if (Datai->Date==0) Print(19,i+2,0,15,"DIR");
		Datai++;
	 }
  }
  PrintInt(2,CPos,7,15,Pos+CPos-1);
  Datai=Da; Datai+=Pos+CPos-2;
  memset(Word,32,16);
  strcpy(Word,Datai->FileName);
  Word[strlen(Word)]=32; Word[15]=0;
  Print(7,CPos,7,15,Word);
  if (Datai->Date==0) Print(19,CPos,7,15,"DIR");
}
开发者ID:fielder,项目名称:NWT,代码行数:34,代码来源:filepart.c


示例11: main

int main(void){
	int a = 1;
	int b = 2;
	int c = 3;
	
	PrintInt(FiveTimes(a));
	PrintInt(FiveTimes(b));
	PrintInt(FiveTimes(c));
	return 0;
}
开发者ID:howardking,项目名称:CodeDomain,代码行数:10,代码来源:pazzle14.c


示例12: main

int main()
{
	int a=1,b=2,c=3;

	PrintInt(FiveIimes(a));
	PrintInt(FiveIimes(b));
	PrintInt(FiveIimes(c));

	return 0;
}
开发者ID:daige,项目名称:c-puzzles,代码行数:10,代码来源:32.c


示例13: main

int main(int argc, char **argv)
{
    int a = 1, b = 2, c = 3;

    PrintInt(FiveTimes(a));
    PrintInt(FiveTimes(b));
    PrintInt(FiveTimes(c));

    return 0;
}
开发者ID:linzhenhua,项目名称:src,代码行数:10,代码来源:main11.c


示例14:

void	CAStreamBasicDescription::PrintToLog(const AudioStreamBasicDescription& inDesc)
{
	PrintFloat		("  Sample Rate:        ", inDesc.mSampleRate);
	Print4CharCode	("  Format ID:          ", inDesc.mFormatID);
	PrintHex		("  Format Flags:       ", inDesc.mFormatFlags);
	PrintInt		("  Bytes per Packet:   ", inDesc.mBytesPerPacket);
	PrintInt		("  Frames per Packet:  ", inDesc.mFramesPerPacket);
	PrintInt		("  Bytes per Frame:    ", inDesc.mBytesPerFrame);
	PrintInt		("  Channels per Frame: ", inDesc.mChannelsPerFrame);
	PrintInt		("  Bits per Channel:   ", inDesc.mBitsPerChannel);
}
开发者ID:NikolaiUgelvik,项目名称:sooperlooper,代码行数:11,代码来源:CAStreamBasicDescription.cpp


示例15: main

int main (void) {
	unsigned int data[2];
	Init();
	while(1) {
		LineData(data);
		PrintInt(data[LEFT]);
		SerPrint("\n");
		PrintInt(data[RIGHT]);
		SerPrint("\n\n\n");
		Msleep(500);
	}
}
开发者ID:lluchs,项目名称:asuro,代码行数:12,代码来源:ain.c


示例16: main

int
main()
{
	int n;
	int arr[N_MAX];
	int i, j;

	PrintString("Nhap N (N <= 100): ");
	n = ReadInt();
	while (n == 0 || n > 100) {
		PrintString("So nhap khong hop le, vui long nhap lai: ");
		n = ReadInt();
	}

	/* Input N integers */
	for (i = 0; i < n; i++) {
		PrintString("Nhap vao so nguyen thu ");
		PrintInt(i+1);
		PrintString(": ");
		arr[i] = ReadInt();
		while (arr[i] == 0) {
			PrintString("Nhap khong hop le, vui long nhap lai: ");
			arr[i] = ReadInt();
		}
	}

	/* Bubble sort */
	for (i = 0; i < n - 1; i++) {
		/* Last i integers are already sorted */
		for (j = 0; j < n - i - 1; j++) {
			if (arr[j] > arr[j + 1]) {
				/* Swap two integers */
				arr[j]     ^= arr[j + 1];
				arr[j + 1] ^= arr[j];
				arr[j]     ^= arr[j + 1];
			}
		}
	}

	/* Print N sorted integers */
	PrintString("Day so da sap xep:\n");
	for (i = 0; i < n - 1; i++) {
		PrintInt(arr[i]);
		PrintString(", ");
	}
	/* Last integer */
	PrintInt(arr[n - 1]);
	PrintString(".\n");

	return 0;
}
开发者ID:dtn97,项目名称:OperatingSystem,代码行数:51,代码来源:sort.c


示例17: ManagerCountMoney

void ManagerCountMoney(int* appMoney, int* picMoney, int* passMoney, int* cashMoney) {
	int i; /* for loops */
	int total; /* total money */

	Acquire(moneyLock);
	for(i = 0; i < NUM_APPCLERKS; i++) {
		*appMoney += GetMV(appClerkMoney, i);
		SetMV(appClerkMoney, i, 0);
	}
	Acquire(outputLock);
	Print("Manager has counted a total of $", 32);
	PrintInt((*appMoney) * 10);
	Print(" for Application Clerks.\n", 25);
	Release(outputLock);
	for(i = 0; i < NUM_PICCLERKS; i++) {
		*picMoney += GetMV(picClerkMoney, i);
		SetMV(picClerkMoney, i, 0);
	}
	Acquire(outputLock);
	Print("Manager has counted a total of $", 32);
	PrintInt((*picMoney) * 10);
	Print(" for Picture Clerks.\n", 21);
	Release(outputLock);
	for(i = 0; i < NUM_PASSCLERKS; i++) {
		*passMoney += GetMV(passClerkMoney, i);
		SetMV(passClerkMoney, i, 0);
	}
	Acquire(outputLock);
	Print("Manager has counted a total of $", 32);
	PrintInt((*passMoney) * 10);
	Print(" for Passport Clerks.\n", 22);
	Release(outputLock);
	for(i = 0; i < NUM_CASHIERS; i++) {
		*cashMoney += GetMV(cashierMoney, i);
		SetMV(cashierMoney, i, 0);
	}
	Acquire(outputLock);
	Print("Manager has counted a total of $", 32);
	PrintInt((*cashMoney) * 10);
	Print(" for Cashiers.\n", 15);
	Release(outputLock);
	total = *appMoney + *picMoney + *passMoney + *cashMoney;
	Acquire(outputLock);
	Print("Manager has counted a total of $", 32);
	PrintInt(total*10);
	Print(" for the Passport Office.\n", 26);
	Release(outputLock);
	Release(moneyLock);
}
开发者ID:RollinBakerUSC,项目名称:350Project1,代码行数:49,代码来源:manager.c


示例18: main

main()
        {
                int     n;
                for (n=20;n<=25;n++)
                        PrintInt(n);

        }
开发者ID:MrOrz,项目名称:nachos,代码行数:7,代码来源:test2.c


示例19: main

int
main()
{
    int i, sum=0;
    
    for (i=0; i<2*SIZE1/3; i++) sum += array1[i];
    for (i=0; i<SIZE1/3; i++) sum += array1[i];
    for (i=2*SIZE1/3; i<SIZE1; i++) sum += array1[i];
    for (i=SIZE1/3; i<2*SIZE1/3; i++) sum += array1[i];

    for (i=0; i<2*SIZE2/3; i++) sum += array2[i];
    for (i=0; i<SIZE2/3; i++) sum += array2[i];
    for (i=2*SIZE2/3; i<SIZE2; i++) sum += array2[i];
    for (i=SIZE2/3; i<2*SIZE2/3; i++) sum += array2[i];

    for (i=0; i<2*SIZE3/3; i++) sum += array3[i];
    for (i=0; i<SIZE3/3; i++) sum += array3[i];
    for (i=2*SIZE3/3; i<SIZE3; i++) sum += array3[i];
    for (i=SIZE3/3; i<2*SIZE3/3; i++) sum += array3[i];

    for (i=0; i<2*SIZE4/3; i++) sum += array4[i];
    for (i=0; i<SIZE4/3; i++) sum += array4[i];
    for (i=2*SIZE4/3; i<SIZE4; i++) sum += array4[i];
    for (i=SIZE4/3; i<2*SIZE4/3; i++) sum += array4[i];

    PrintString("Total sum: ");
    PrintInt(sum);
    PrintChar('\n');
    return 0;
}
开发者ID:irfanhudda,项目名称:nachos-assign3,代码行数:30,代码来源:vmtest2.c


示例20: drawLocalHighScoreMenu

/**
 * \brief Draws local high score menu.
 *
 * Uses the values saved in the topscores array, not eeprom values, this allows displaying scores separately from saving/loading.
 */
void drawLocalHighScoreMenu(void)
{
	//set cursor for use with this menu (may one day be needed for scrolling)
	menu_x = fakemod((drawX+9),VRAM_TILES_H);
	menu_y = 15;
	ClearVram(); //blank screen
	drawFrame(); //draw generic gui frame
	Print(fakemod((drawX+6),VRAM_TILES_H),3,PSTR("LOCAL TOP SCORES:")); //write menu title at top of screen

	for(u8 i = 0; i < 10; i++) //print scores 1 - 10 from topscores array
	{
		PrintInt(fakemod((drawX+17),VRAM_TILES_H),6+(i<<1),topscores[i], false);
		PrintInt(fakemod((drawX+11),VRAM_TILES_H),6+(i<<1),i+1, false);
		Print(fakemod((drawX+12),VRAM_TILES_H),6+(i<<1),PSTR("."));
	}
}
开发者ID:kivan117,项目名称:gghost,代码行数:21,代码来源:gghost.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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