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

C++ PrintString函数代码示例

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

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



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

示例1: GameRender

void GameRender(void)
{
	u_int uColor = (dbg_collided)? 0x80FF8080 : 0x8080FF80;

	PolyColl::Render(m_xPosition[0], uColor, 0xFFFFFFFF, m_pxVertices[0], m_iNumVertices[0]);
	PolyColl::Render(m_xPosition[1], uColor, 0xFF000000, m_pxVertices[1], m_iNumVertices[1]);

	PrintString(m_xPosition[0].x, m_xPosition[0].y, true, 0xFFFFFFFF, "Poly A");
	PrintString(m_xPosition[1].x, m_xPosition[1].y, true, 0xFFFFFFFF, "Poly B");

	if (dbg_collided)
	{
		// render the collision stuff
		RenderArrow((m_xPosition[0] + m_xPosition[1]) * 0.5f, Ncoll, fabs(dcoll), 0xFFFFFFFF);

		PrintString(1, 1, false, 0xFFFFFFFF, "Press 'RETURN' to separate the objects");
	}
}
开发者ID:ChenguangZhang,项目名称:oli-demos,代码行数:18,代码来源:GameCode.cpp


示例2: PrintCaptions

static void PrintCaptions() {
	glEnable(GL_BLEND);
	glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
	glColor4f(0.f, 0.f, 0.f, 0.8f);
	glRecti(0, session->film->GetHeight() - 15,
			session->film->GetWidth() - 1, session->film->GetHeight() - 1);
	glRecti(0, 0, session->film->GetWidth() - 1, 18);
	glDisable(GL_BLEND);

	// Caption line 0
	glColor3f(1.f, 1.f, 1.f);
	glRasterPos2i(4, 5);
	PrintString(GLUT_BITMAP_8_BY_13, captionBuffer);

	// Title
	glRasterPos2i(4, session->film->GetHeight() - 10);
	PrintString(GLUT_BITMAP_8_BY_13, SLG_LABEL.c_str());
}
开发者ID:rbrtribeiro,项目名称:smalllux3,代码行数:18,代码来源:displayfunc.cpp


示例3: PrintGpsText

void PrintGpsText()
{
	unsigned int color;
	CVector2D point;
	short text[128];
	if(*g_TimeMs < gGpsTextTimer + GPS_TEXT_TIME)
	{
		switch(gCurrentGpsMode)
		{
		case GPS_MODE_DISABLED:
			AsciiToUnicode("GPS Mode: Disabled", text);
			break;
		case GPS_MODE_DEFAULT:
			AsciiToUnicode("GPS Mode: Default", text);
			break;
		case GPS_MODE_AMMUNATION:
			if(*gCurrLevel != LEVEL_SHORESIDE)
				AsciiToUnicode("GPS Mode: Ammu-Nation", text);
			else
				AsciiToUnicode("GPS Error: can't find Ammu-Nation", text);
			break;
		case GPS_MODE_BOMBSHOP:
			AsciiToUnicode("GPS Mode: Bomb Shop", text);
			break;
		case GPS_MODE_FIRESTATION:
			AsciiToUnicode("GPS Mode: Fire Station", text);
			break;
		case GPS_MODE_HOSPITAL:
			AsciiToUnicode("GPS Mode: Hospital", text);
			break;
		case GPS_MODE_PAYNSPRAY:
			AsciiToUnicode("GPS Mode: Pay'N'Spray", text);
			break;
		case GPS_MODE_POLICE:
			AsciiToUnicode("GPS Mode: Police", text);
			break;
		case GPS_MODE_SAFEHOUSE:
			AsciiToUnicode("GPS Mode: Safehouse", text);
			break;
		default:
			AsciiToUnicode("GPS Error: Unknown command", text);
		}
		color = 0xFFFFFFFF;
		SetFontStyle(0);
		SetScale(0.7f, 1.0f);
		SetColor(&color);
		SetJustifyOn();
		SetDropShadowPosition(1);
		SetPropOn();
		point.x = -1.0f;
		point.y = -1.0f;
		TransformRadarPointToScreenSpace(point, point);
		PrintString(point.x, point.y + 10.0f, text);
		SetDropShadowPosition(0);
		SetFontStyle(0);
	}
}
开发者ID:MehdiNejjar,项目名称:III.VC.GPS,代码行数:57,代码来源:dllmain.cpp


示例4: ChargingControl

/*! Read battery state and update charge output 
 * \note Status can be used to update the LCD screen of a possible change
 * in battery charging state
 */
static void ChargingControl(void)
{
  /* prepare to read status bits */
  BAT_CHARGE_OUT |= BAT_CHARGE_STATUS_OPEN_DRAIN_BITS;

  /* always enable the charger (it may already be enabled)
   * status bits are not valid unless charger is enabled 
   */
  BATTERY_CHARGE_ENABLE();

  /* wait until signals are valid - measured 400 us 
   * during this delay we will also run the software FLL
   */
  TaskDelayLpmDisable();
  
  /* disable BT flow during FLL loop */
  portENTER_CRITICAL();
  unsigned char FlowDisabled = QueryFlowDisabled();
  if (!FlowDisabled) DisableFlow();
  portEXIT_CRITICAL();

  EnableSoftwareFll();
  vTaskDelay(1);
  DisableSoftwareFll();
  
  portENTER_CRITICAL();
  if (!FlowDisabled) EnableFlow();
  portEXIT_CRITICAL();

  TaskDelayLpmEnable();
  
  /* Decode the battery state */
  /* mask and shift to get the current battery charge status */
  ChargeStatus = BAT_CHARGE_IN & (BAT_CHARGE_STAT1 | BAT_CHARGE_STAT2);

  switch (ChargeStatus)
  {
  case CHARGE_STATUS_PRECHARGE:   PrintString(".");  break;
  case CHARGE_STATUS_FAST_CHARGE: PrintString(":"); break;
  case CHARGE_STATUS_DONE:        PrintString("|"); break;
  case CHARGE_STATUS_OFF:         PrintString("ChargeOff");  break;
  default:                        PrintString("Charge???");  break;
  }
}
开发者ID:Tangkw,项目名称:MetaWatch-Gen2,代码行数:48,代码来源:hal_battery.c


示例5: StartBrowserService

NET_API_STATUS
StartBrowserService(LPTSTR wcMachineName)
{
DWORD     LastError;
SC_HANDLE ServiceControllerHandle;
SC_HANDLE ServiceHandle;

    sprintf(PrintBuf,"\nTrying to start Browser on %s.", UnicodeToPrintfString(wcMachineName));
    PrintString(TOSCREENANDLOG, PrintBuf);

    ServiceControllerHandle = OpenSCManager(wcMachineName, NULL, SC_MANAGER_ALL_ACCESS);
    if (ServiceControllerHandle == NULL) {
        return GetLastError();
    }

    ServiceHandle = OpenService(ServiceControllerHandle, BROWSER, SERVICE_ALL_ACCESS);
    if (ServiceHandle == NULL) {
        CloseServiceHandle(ServiceControllerHandle);
        return GetLastError();
    }


    if(!StartService(ServiceHandle, 0, NULL)){
        CloseServiceHandle(ServiceHandle);
        CloseServiceHandle(ServiceControllerHandle);

        LastError = GetLastError();

        if(LastError != ERROR_SERVICE_ALREADY_RUNNING)
           return LastError;
        else {
           sprintf(PrintBuf,"\nBrowser already running on %s.\n", UnicodeToPrintfString(wcMachineName));
           PrintString(TOSCREENANDLOG, PrintBuf);
           return NERR_Success;
        }
    }

    sprintf(PrintBuf,"\nStarted Browser on %s.\n", UnicodeToPrintfString(wcMachineName));
    PrintString(TOSCREENANDLOG, PrintBuf);

    CloseServiceHandle(ServiceHandle);
    CloseServiceHandle(ServiceControllerHandle);
    return NERR_Success;
}
开发者ID:mingpen,项目名称:OpenNT,代码行数:44,代码来源:browutil.c


示例6: EditMemoryInit

//******************************************************************
//  EditMemoryInit
//  FILENAME:
//  PARAMETERS:
//  DESCRIPTION: 
//  RETURNS:
//*******************************************************************
void EditMemoryInit(int initstate)
{
	read_sw();
	if(GetKey(MODE_KEY))
	{
		// reset nickname -> nickname discovery
		vscp_setNickname( VSCP_ADDRESS_FREE );
		PrintString( (UINT8 const *)"\n\rRESET NICKNAME" );
	}
}
开发者ID:grodansparadis,项目名称:vscp_firmware,代码行数:17,代码来源:emem.c


示例7: Housekeeping

/* when debugging one may want to disable this */
static void Housekeeping(void)
{
  if (   gBtStats.MallocFailed
      || gBtStats.RxDataOverrun
      || gBtStats.RxInvalidStartCallback )
  {
    PrintString("************Bluetooth Failure************\r\n");
    __delay_cycles(100000);
    ForceWatchdogReset();
  }
  
  if ( gAppStats.BufferPoolFailure )
  {
    PrintString("************Application Failure************\r\n");
    __delay_cycles(100000);
    ForceWatchdogReset();
  }
  
}
开发者ID:rbrowngt,项目名称:MetaWatch-WDS11x-IAR,代码行数:20,代码来源:main.c


示例8: testStringIndex

void testStringIndex() {
	printf("input the main string:\n");
	SString S;
	CreateString(S);
	PrintString(S);

	printf("input the sub string:\n");
	SString S2;
	CreateString(S2);
	PrintString(S2);

	printf("general matching algirothm:\n");
	int pos = Index(S, S2, 1);
	printf("the position of the substring in the main string is: %d\n", pos);

	printf("kmp  matching algirothm:\n");
	pos = Index_KMP(S, S2, 1);
	printf("the position of the substring in the main string is: %d\n", pos);
}
开发者ID:kongsicong,项目名称:DataStructure,代码行数:19,代码来源:testString.cpp


示例9: BPL_FreeMessageBuffer

void BPL_FreeMessageBuffer(unsigned char* pBuffer)
{
  // make sure the returned pointer is in range
  if (   pBuffer < LOW_BUFFER_ADDRESS 
      || pBuffer > HIGH_BUFFER_ADDRESS )
  {
    PrintString("Free Buffer Corruption\r\n");
    SetBufferPoolFailureBit();
  }

  // params are: queue handle, ptr to item to queue, tick to wait if full
  // the queue can't be full unless there is a bug, so don't wait on full
  if( pdTRUE != xQueueSend(QueueHandles[FREE_QINDEX], &pBuffer, DONT_WAIT) )
{
    PrintString("Unable to add buffer to Free Queue\r\n");
    SetBufferPoolFailureBit();
  }

}
开发者ID:Alucard3571,项目名称:MetaWatch-WDS11x,代码行数:19,代码来源:BufferPool.c


示例10: Display_Raw

void Display_Raw(float accel[3], float gyro[3], float temp)		//Display raw Accel Gyro and Tempreature Values
{
	PrintString("\nAccel\tTemp\tGyro\t");
	
	for(uint8_t i=0;i<3;i++)
	{
		PrintFloat(accel[i]);
		PrintString("\t");
	}
	
	PrintFloat(temp);
	PrintString("\t");
	
	for(uint8_t i=0;i<3;i++)
	{
		PrintFloat(gyro[i]);
		PrintString("\t");
	}
}
开发者ID:spookymelonhead,项目名称:Tuna_fish,代码行数:19,代码来源:main.c


示例11: main

int main(){
	PrintString("Setting monitors\n", 17);
  Acquire(lock1);
	SetMonitor(mon1, 0, 9);
	for (i = 0; i < 30000; ++i){
		Yield();
	}
	Release(lock1);
	PrintString("Waiting on lock2\n", 17);
	Acquire(lock1);
  Wait(lock1, cond1);
	Release(lock1);

	PrintString("Destroying Monitors 1 and 2\n", 28);
	DestroyMonitor(mon1);
	DestroyMonitor(mon2);

	Exit(1);
}
开发者ID:freyconner24,项目名称:CS350Project3,代码行数:19,代码来源:monServer_t1.c


示例12: printMoney

/*Function to print money owned by clerks*/
void printMoney() {
    int totalMoney = 0;
    int applicationMoney = 0;
    int pictureMoney = 0;
    int passportMoney = 0;
    int cashierMoney = 0;
    int i, tempMon;
    for(i = 0; i < clerkCount; ++i) {
        tempMon = GetMonitor(clerkMoney, i);
        if (i < clerkArray[0]) { /*ApplicationClerk index*/
            applicationMoney += tempMon;
        } else if (i < clerkArray[0] + clerkArray[1]) { /*PictureClerk index*/
            pictureMoney += tempMon;
        } else if (i < clerkArray[0] + clerkArray[1] + clerkArray[2]) { /*PassportClerk index*/
            passportMoney += tempMon;
        } else if (i < clerkArray[0] + clerkArray[1] + clerkArray[2] + clerkArray[3]) { /*Cashier index*/
            cashierMoney += tempMon;
        }
        totalMoney += tempMon;
    }
    applicationMoney = applicationMoney * 100;
    pictureMoney = pictureMoney * 100;
    passportMoney = passportMoney * 100;
    cashierMoney = cashierMoney * 100;
    totalMoney = totalMoney * 100;

    PrintString("Manager has counted a total of ", 31);
    PrintNum(applicationMoney);
    PrintString(" for ApplicationClerks\n", 23);
    PrintString("Manager has counted a total of ", 31);
    PrintNum(pictureMoney);
    PrintString(" for PictureClerks\n", 19);
    PrintString("Manager has counted a total of ", 31);
    PrintNum(passportMoney);
    PrintString(" for PassportClerks\n", 20);
    PrintString("Manager has counted a total of ", 31);
    PrintNum(cashierMoney);
    PrintString(" for Cashiers\n", 14);
    PrintString("Manager has counted a total of ", 31);
    PrintNum(totalMoney);
    PrintString(" for passport office\n", 21);
}
开发者ID:freyconner24,项目名称:CS350Project4,代码行数:43,代码来源:manager.c


示例13: DisplayCallBack

	virtual void DisplayCallBack() {
		ComputeImage();
		bitmap->draw();

		glEnable(GL_BLEND);
		glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
		glColor4f(0.f, 0.f, 0.f, 0.8f);
		glRecti(0, windowHeight - 30,
				windowWidth - 1, windowHeight - 1);
		glRecti(0, 0, windowWidth - 1, 18);
		glDisable(GL_BLEND);

		// Title
		glColor3f(1.f, 1.f, 1.f);
		glRasterPos2i(4, windowHeight - 10);
		PrintString(GLUT_BITMAP_8_BY_13, "JugCLer 1.0 by Holger Bettag ([email protected])");
		glRasterPos2i(4, windowHeight - 25);
		PrintString(GLUT_BITMAP_8_BY_13, "Heavily inspired by Michael Birken's"
				" reverse engineering of Eric Graham's original Amiga"
				" juggler demo");

		// Caption line 0
		const std::string captionString = boost::str(boost::format("[60Hz screen refresh][No-Vsync %.1f Frame/sec][%.1fM Sample/sec]") %
				frameSec % (frameSec * windowWidth * windowHeight / 1000000.0));

		glColor3f(1.f, 1.f, 1.f);
		glRasterPos2i(4, 5);
		PrintString(GLUT_BITMAP_8_BY_13, captionString.c_str());

		if (printHelp) {
			glPushMatrix();
			glLoadIdentity();
			glOrtho(-.5f, windowWidth - .5f,
				-.5f, windowHeight - .5f, -1.f, 1.f);

			PrintHelp();

			glPopMatrix();
		}

		glutSwapBuffers();
	}
开发者ID:adammaj1,项目名称:ocltoys,代码行数:42,代码来源:jugCLer.cpp


示例14: SystemHang

VOID
SystemHang (
  CHAR8        *Message
  )
{
  PrintString (
    "%s## FATAL ERROR ##: Fail to load DUET images! System hang!\n",
    Message
    );
  CpuDeadLoop();
}
开发者ID:b-man,项目名称:edk2,代码行数:11,代码来源:EfiLoader.c


示例15: PrintInfo

static void
PrintInfo(void)
{
   char s[100];

   glDisable(GL_FOG);
   glColor3f(0, 1, 1);

   sprintf(s, "Mode(m): %s  Start(s/S): %g  End(e/E): %g  Density(d/D): %g",
           ModeStr, fogStart, fogEnd, fogDensity);
   glWindowPos2iARB(5, 20);
   PrintString(s);

   sprintf(s, "Arrays(a): %s  glFogCoord(c): %s  EyeZ(z/z): %g",
           (Arrays ? "Yes" : "No"),
           (fogCoord ? "Yes" : "No"),
           camz);
   glWindowPos2iARB(5, 5);
   PrintString(s);
}
开发者ID:aosm,项目名称:X11apps,代码行数:20,代码来源:fogcoord.c


示例16: PrintString

void TOperandString::Print(OutStream &out) const
{
  if (m_data_length != 0) {
    out << '\"';
    PrintString(out, m_data, m_data_length);
    out << '\"';
  }
  else {
    out << "null";
  }
}
开发者ID:brifordwylie,项目名称:turnersr.github.io,代码行数:11,代码来源:operand.cpp


示例17: Display_Song_Length

void Display_Song_Length(void)
{
    char ms[64];

    if(userscreen == USER_SCREEN_DISKIO_EDIT)
    {
        sprintf(ms, "%.2d:%.2d:%.2d", song_Hours, song_Minutes, song_Seconds);
        Gui_Draw_Button_Box(254, (Cur_Height - 58), 80, 16, "", BUTTON_NORMAL | BUTTON_DISABLED);
        PrintString(274, (Cur_Height - 56), USE_FONT, ms);
    }
}
开发者ID:Phil974m,项目名称:protrekkr,代码行数:11,代码来源:editor_diskio.cpp


示例18: 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


示例19: BPL_AllocMessageBuffer

unsigned char* BPL_AllocMessageBuffer(void)
{
  unsigned char * pBuffer = NULL;

  // params are: queue handle, ptr to the msg buffer, ticks to wait
  if( pdTRUE != xQueueReceive( QueueHandles[FREE_QINDEX], &pBuffer, DONT_WAIT ) )
  {
    PrintString("Unable to Allocate Buffer\r\n");
    SetBufferPoolFailureBit();
  }

  if (   pBuffer < LOW_BUFFER_ADDRESS 
      || pBuffer > HIGH_BUFFER_ADDRESS )
  {
    PrintString("Free Buffer Corruption\r\n");
    SetBufferPoolFailureBit();
}

  return pBuffer;

}
开发者ID:Alucard3571,项目名称:MetaWatch-WDS11x,代码行数:21,代码来源:BufferPool.c


示例20: PrintWin32Error

VOID
PrintWin32Error(IN LPWSTR Message, IN DWORD ErrorCode)
{
    LPWSTR lpMsgBuf;

    FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
                   NULL, ErrorCode, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
                   (LPWSTR)&lpMsgBuf, 0, NULL);

    PrintString(L"%s: %s\n", Message, lpMsgBuf);
    LocalFree(lpMsgBuf);
}
开发者ID:Moteesh,项目名称:reactos,代码行数:12,代码来源:main.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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