您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ sstrcat函数代码示例

51自学网 2021-06-03 08:20:25
  C++
这篇教程C++ sstrcat函数代码示例写得很实用,希望能帮到您。

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

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

示例1: getPlayerName

// ////////////////////////////////////////////////////////////////////////////// return a players name.const char* getPlayerName(int player){	ASSERT_OR_RETURN(NULL, player < MAX_PLAYERS , "Wrong player index: %u", player);	if (game.type != CAMPAIGN)	{		if (strcmp(playerName[player], "") != 0)		{			return (char*)&playerName[player];		}	}	if (strlen(NetPlay.players[player].name) == 0)	{		// make up a name for this player.		return getPlayerColourName(player);	}	else if (NetPlay.players[player].ai >= 0 && !NetPlay.players[player].allocated)	{		static char names[MAX_PLAYERS][StringSize];  // Must be static, since the getPlayerName() return value is used in tool tips... Long live the widget system.		// Add colour to player name.		sstrcpy(names[player], getPlayerColourName(player));		sstrcat(names[player], "-");		sstrcat(names[player], NetPlay.players[player].name);		return names[player];	}	return NetPlay.players[player].name;}
开发者ID:mikevdg,项目名称:warzone2100-pathing,代码行数:31,


示例2: poptPrintHelp

static void poptPrintHelp(poptContext ctx, FILE *output, WZ_DECL_UNUSED int unused){	int i;	fprintf(output, "Usage: %s [OPTION...]/n", ctx->argv[0]);	for (i = 0; i < ctx->size; i++)	{		char txt[128];		if (ctx->table[i].short_form != '/0')		{			ssprintf(txt, "  -%c, --%s", ctx->table[i].short_form, ctx->table[i].string);		}		else		{			ssprintf(txt, "  --%s", ctx->table[i].string);		}		if (ctx->table[i].argument)		{			sstrcat(txt, "=");			sstrcat(txt, ctx->table[i].argDescrip);		}		fprintf(output, "%-40s", txt);		if (ctx->table[i].descrip)		{			fprintf(output, "%s", ctx->table[i].descrip);		}		fprintf(output, "/n");	}}
开发者ID:Manistein,项目名称:warzone2100,代码行数:32,


示例3: poptPrintHelp

static void poptPrintHelp(poptContext ctx, FILE *output, bool show_all){	fprintf(output, "Usage: %s [OPTION...]/n", ctx->argv[0]);	for (int i = 0; i < ctx->size; i++)	{		char txt[128];		if (ctx->table[i].hidden && !show_all)		{			continue;		}		if (ctx->table[i].short_form != '/0')		{			ssprintf(txt, "  -%c, --%s", ctx->table[i].short_form, ctx->table[i].string);		}		else		{			ssprintf(txt, "  --%s", ctx->table[i].string);		}		if (ctx->table[i].argument)		{			sstrcat(txt, "=");			sstrcat(txt, ctx->table[i].argDescrip);		}		fprintf(output, "%-40s", txt);		if (ctx->table[i].descrip)		{			fprintf(output, "%s", ctx->table[i].descrip);		}		fprintf(output, "/n");	}}
开发者ID:lamyongxian,项目名称:warzone2100,代码行数:35,


示例4: printConsoleNameChange

void printConsoleNameChange(const char *oldName, const char *newName){	char msg[MAX_CONSOLE_STRING_LENGTH];	// Player changed name.	sstrcpy(msg, oldName);                               // Old name.	sstrcat(msg, " → ");                                 // Separator	sstrcat(msg, newName);  // New name.	addConsoleMessage(msg, DEFAULT_JUSTIFY, selectedPlayer);  // display}
开发者ID:mikevdg,项目名称:warzone2100-pathing,代码行数:11,


示例5: recvTextMessage

// Write a message to the console.bool recvTextMessage(NETQUEUE queue){	UDWORD	playerIndex;	char	msg[MAX_CONSOLE_STRING_LENGTH];	char newmsg[MAX_CONSOLE_STRING_LENGTH];	memset(msg, 0x0, sizeof(msg));	memset(newmsg, 0x0, sizeof(newmsg));	NETbeginDecode(queue, NET_TEXTMSG);		// Who this msg is from		NETuint32_t(&playerIndex);		// The message to send		NETstring(newmsg, MAX_CONSOLE_STRING_LENGTH);	NETend();	if (whosResponsible(playerIndex) != queue.index)	{		playerIndex = queue.index;  // Fix corrupted playerIndex.	}	if (playerIndex >= MAX_PLAYERS || (!NetPlay.players[playerIndex].allocated && NetPlay.players[playerIndex].ai == AI_OPEN))	{		return false;	}	sstrcpy(msg, NetPlay.players[playerIndex].name);	// Seperator	sstrcat(msg, ": ");	// Add message	sstrcat(msg, newmsg);	addConsoleMessage(msg, DEFAULT_JUSTIFY, playerIndex);	// Multiplayer message callback	// Received a console message from a player, save	MultiMsgPlayerFrom = playerIndex;	MultiMsgPlayerTo = selectedPlayer;	sstrcpy(MultiplayMsg, newmsg);	eventFireCallbackTrigger((TRIGGER_TYPE)CALL_AI_MSG);	// make some noise!	if (titleMode == MULTIOPTION || titleMode == MULTILIMIT)	{		audio_PlayTrack(FE_AUDIO_MESSAGEEND);	}	else if (!ingame.localJoiningInProgress)	{		audio_PlayTrack(ID_SOUND_MESSAGEEND);	}	return true;}
开发者ID:mikevdg,项目名称:warzone2100-pathing,代码行数:55,


示例6: initI18n

void initI18n(void){	const char *textdomainDirectory = NULL;	if (!setLanguage("")) // set to system default	{		// no system default?		debug(LOG_ERROR, "initI18n: No system language found");	}#if defined(WZ_OS_WIN)	{		// Retrieve an absolute path to the locale directory		char localeDir[PATH_MAX];		sstrcpy(localeDir, PHYSFS_getBaseDir());		sstrcat(localeDir, "//" LOCALEDIR);		// Set locale directory and translation domain name		textdomainDirectory = bindtextdomain(PACKAGE, localeDir);	}#else	#ifdef WZ_OS_MAC	{		char resourcePath[PATH_MAX];		CFURLRef resourceURL = CFBundleCopyResourcesDirectoryURL(CFBundleGetMainBundle());		if( CFURLGetFileSystemRepresentation( resourceURL, true, (UInt8 *) resourcePath, PATH_MAX) )		{			sstrcat(resourcePath, "/locale");			textdomainDirectory = bindtextdomain(PACKAGE, resourcePath);		}		else		{			debug( LOG_ERROR, "Could not change to resources directory." );		}		if (resourceURL != NULL)		{			CFRelease(resourceURL);		}		debug(LOG_INFO, "resourcePath is %s", resourcePath);	}	#else	textdomainDirectory = bindtextdomain(PACKAGE, LOCALEDIR);	#endif#endif	if (!textdomainDirectory)	{		debug(LOG_ERROR, "initI18n: bindtextdomain failed!");	}	(void)bind_textdomain_codeset(PACKAGE, "UTF-8");	(void)textdomain(PACKAGE);}
开发者ID:JCDG,项目名称:warzone2100,代码行数:53,


示例7: AssertStr

FILE *MacFopen(const char *path, const char *mode){static char TruncPath[NAME_MAX];OSErr   err = 0;AssertStr(path,path)            /* open zipfile or tempzip */if (strcmp(zipfile,path) == 0)    {    GetCompletePath(MacZip.ZipFullPath,path,&MacZip.ZipFileSpec,&err);    err = PrintUserHFSerr((err != -43) && (err != 0), err, path);    printerr("GetCompletePath:",err,err,__LINE__,__FILE__,path);    if (CheckMountedVolumes(MacZip.ZipFullPath) > 1)        DoWarnUserDupVol(MacZip.ZipFullPath);    /* tempfile should appear in the same directory of the zipfile       -> save path of zipfile */    TruncFilename(TruncPath, MacZip.ZipFullPath);    return fopen(MacZip.ZipFullPath, mode);    }if (strcmp(tempzip,path) == 0)    {  /* add path of zipfile */    sstrcat(TruncPath,tempzip);    GetCompletePath(MacZip.TempZipFullPath,TruncPath,&MacZip.TempZipFileSpec,&err);    err = PrintUserHFSerr((err != -43) && (err != 0), err, path);    printerr("GetCompletePath:",err,err,__LINE__,__FILE__,path);    return fopen(MacZip.TempZipFullPath, mode);    }printerr("MacFopen:",err,err,__LINE__,__FILE__,path);return NULL;}
开发者ID:ProjectZeroSlackr,项目名称:CmdLine-Archivers,代码行数:35,


示例8: bm_printboardapi

int bm_printboardapi(struct boardmanager *bm,char *farg){	if (getboard(bm->board)){		sstrcat(farg, "/"%s/",",bm->board);	}	return 0;}
开发者ID:deepurple,项目名称:bbssrc,代码行数:7,


示例9: iV_printFontList

static inline void iV_printFontList(void){	unsigned int i;	unsigned int font_count = glcGeti(GLC_CURRENT_FONT_COUNT);	debug(LOG_NEVER, "GLC_CURRENT_FONT_COUNT = %d", font_count);	if (font_count == 0)	{		debug(LOG_ERROR, "The required font (%s) isn't loaded", font_family);		// Fall back to unselected fonts since the requested font apparently		// isn't available.		glcEnable(GLC_AUTO_FONT);	}	for (i = 0; i < font_count; ++i)	{		GLint font = glcGetListi(GLC_CURRENT_FONT_LIST, i);		/* The output of the family name and the face is printed using 2 steps		 * because glcGetFontc and glcGetFontFace return their result in the		 * same buffer (according to GLC specs).		 */		char prBuffer[1024];		snprintf(prBuffer, sizeof(prBuffer), "Font #%d : %s ", (int)font, (const char *)glcGetFontc(font, GLC_FAMILY));		prBuffer[sizeof(prBuffer) - 1] = 0;		sstrcat(prBuffer, (char const *)glcGetFontFace(font));		debug(LOG_NEVER, "%s", prBuffer);	}}
开发者ID:C1annad,项目名称:warzone2100,代码行数:29,


示例10: va_start

char *pstrcat(pool *p, ...) {  char *argp, *ptr, *res;  size_t len = 0;  va_list ap;  if (p == NULL) {    errno = EINVAL;    return NULL;  }  va_start(ap, p);  while ((res = va_arg(ap, char *)) != NULL) {    len += strlen(res);  }  va_end(ap);  ptr = res = pcalloc(p, len + 1);  va_start(ap, p);  while ((argp = va_arg(ap, char *)) != NULL) {    size_t arglen;    arglen = strlen(argp);    sstrcat(ptr, argp, len + 1);    ptr += arglen;  }  va_end(ap);  return res;}
开发者ID:Nakor78,项目名称:proftpd,代码行数:34,


示例11: iV_GetTexture

/** Retrieve the texture number for a given texture resource. * *  @note We keep textures in a separate data structure _TEX_PAGE apart from the *        normal resource system. * *  @param filename The filename of the texture page to search for. *  @param compression If we need to load it, should we use texture compression? * *  @return a non-negative index number for the texture, negative if no texture *          with the given filename could be found */int iV_GetTexture(const char *filename, bool compression){	iV_Image sSprite;	char path[PATH_MAX];	/* Have we already loaded this one then? */	sstrcpy(path, filename);	pie_MakeTexPageName(path);	for (int i = 0; i < _TEX_PAGE.size(); i++)	{		if (strncmp(path, _TEX_PAGE[i].name, iV_TEXNAME_MAX) == 0)		{			return i;		}	}	// Try to load it	sstrcpy(path, "texpages/");	sstrcat(path, filename);	if (!iV_loadImage_PNG(path, &sSprite))	{		debug(LOG_ERROR, "Failed to load %s", path);		return -1;	}	sstrcpy(path, filename);	pie_MakeTexPageName(path);	return pie_AddTexPage(&sSprite, path, compression);}
开发者ID:Zabanya,项目名称:warzone2100,代码行数:39,


示例12: iV_GetTexture

/** Retrieve the texture number for a given texture resource. * *  @note We keep textures in a separate data structure _TEX_PAGE apart from the *        normal resource system. * *  @param filename The filename of the texture page to search for. * *  @return a non-negative index number for the texture, negative if no texture *          with the given filename could be found */int iV_GetTexture(const char *filename){    unsigned int i = 0;    iV_Image sSprite;    char path[PATH_MAX];    /* Have we already loaded this one then? */    sstrcpy(path, filename);    pie_MakeTexPageName(path);    for (i = 0; i < iV_TEX_MAX; i++)    {        if (strncmp(path, _TEX_PAGE[i].name, iV_TEXNAME_MAX) == 0)        {            return i;        }    }    // Try to load it    sstrcpy(path, "texpages/");    sstrcat(path, filename);    if (!iV_loadImage_PNG(path, &sSprite))    {        debug(LOG_ERROR, "Failed to load %s", path);        return -1;    }    sstrcpy(path, filename);    pie_MakeTexPageName(path);    return pie_AddTexPage(&sSprite, path, 0, -1, true);	// FIXME, -1, use getTextureSize()}
开发者ID:nanotech,项目名称:warzone2100,代码行数:39,


示例13: seq_AddSeqToList

//add a sequence to the list to be playedvoid seq_AddSeqToList(const char *pSeqName, const char *pAudioName, const char *pTextName, bool bLoop){	currentSeq++;	ASSERT_OR_RETURN(, currentSeq < MAX_SEQ_LIST, "too many sequences");	//OK so add it to the list	aSeqList[currentSeq].pSeq = pSeqName;	aSeqList[currentSeq].pAudio = pAudioName;	aSeqList[currentSeq].bSeqLoop = bLoop;	if (pTextName != NULL)	{		// Ordinary text shouldn't be justified		seq_AddTextFromFile(pTextName, SEQ_TEXT_POSITION);	}	if (bSeqSubtitles)	{		char aSubtitleName[MAX_STR_LENGTH];		sstrcpy(aSubtitleName, pSeqName);		// check for a subtitle file		char *extension = strrchr(aSubtitleName, '.');		if (extension)		{			*extension = '/0';		}		sstrcat(aSubtitleName, ".txt");		// Subtitles should be center justified		seq_AddTextFromFile(aSubtitleName, SEQ_TEXT_JUSTIFY);	}}
开发者ID:Manistein,项目名称:warzone2100,代码行数:34,


示例14: do_modem_init

/** * Send the command to initialize the gprs of the modem. */static void do_modem_init(gprs_t * gprs){	UNTIMEOUT();    gprs_set_state(gprs,GPRS_STATE_MODEM_INIT);    sstrcpy(gprs->replyBuffer,"AT+CGDCONT=1,/"IP/",/"",sizeof(gprs->replyBuffer));#if	GPRS_RUNTIME_APN    sstrcat(gprs->replyBuffer,gprs->apn,sizeof(gprs->replyBuffer));#else    sstrcat(gprs->replyBuffer,GPRS_APN,sizeof(gprs->replyBuffer));#endif    sstrcat(gprs->replyBuffer,"/"",sizeof(gprs->replyBuffer));    gprs_command(gprs,gprs->replyBuffer,'/r');}
开发者ID:MarioViara,项目名称:gprs,代码行数:21,


示例15: debug_callback_win32debug

void debug_callback_win32debug(WZ_DECL_UNUSED void ** data, const char * outputBuffer){    char tmpStr[MAX_LEN_LOG_LINE];    sstrcpy(tmpStr, outputBuffer);    if (!strchr(tmpStr, '/n'))    {        sstrcat(tmpStr, "/n");    }    OutputDebugStringA( tmpStr );}
开发者ID:blezek,项目名称:warzone2100,代码行数:12,


示例16: show_special_api

void show_special_api(char *id2, char *output){	FILE *fp;	char id1[80], name[80], buf[256];	fp=fopen("etc/special", "r");	if(fp!=0){		while(1){			if(fgets(buf, 256, fp)==0) break;			if(sscanf(buf, "%s %s", id1, name)<2) continue;			if(!strcasecmp(id1, id2)) sstrcat(output, "/"Title/":/"%s/",", name);		}	}	close(fp);}
开发者ID:deepurple,项目名称:bbssrc,代码行数:13,


示例17: displayTitleBitmap

// show a background piccy (currently used for version and mods labels)static void displayTitleBitmap(WZ_DECL_UNUSED WIDGET *psWidget, WZ_DECL_UNUSED UDWORD xOffset, WZ_DECL_UNUSED UDWORD yOffset, WZ_DECL_UNUSED PIELIGHT *pColours){	char modListText[MAX_STR_LENGTH] = "";	iV_SetFont(font_regular);	iV_SetTextColour(WZCOL_GREY);	iV_DrawTextRotated(version_getFormattedVersionString(), pie_GetVideoBufferWidth() - 9, pie_GetVideoBufferHeight() - 14, 270.f);	if (*getModList())	{		sstrcat(modListText, _("Mod: "));		sstrcat(modListText, getModList());		iV_DrawText(modListText, 9, 14);	}	iV_SetTextColour(WZCOL_TEXT_BRIGHT);	iV_DrawTextRotated(version_getFormattedVersionString(), pie_GetVideoBufferWidth() - 10, pie_GetVideoBufferHeight() - 15, 270.f);	if (*getModList())	{		iV_DrawText(modListText, 10, 15);	}}
开发者ID:ArtemusRus,项目名称:warzone2100,代码行数:24,


示例18: registerSearchPath

/*! * Register searchPath above the path with next lower priority * For information about what can be a search path, refer to PhysFS documentation */void registerSearchPath(const char path[], unsigned int priority){	wzSearchPath *curSearchPath = searchPathRegistry, * tmpSearchPath = nullptr;	tmpSearchPath = (wzSearchPath *)malloc(sizeof(*tmpSearchPath));	sstrcpy(tmpSearchPath->path, path);	if (path[strlen(path) - 1] != *PHYSFS_getDirSeparator())	{		sstrcat(tmpSearchPath->path, PHYSFS_getDirSeparator());	}	tmpSearchPath->priority = priority;	debug(LOG_WZ, "registerSearchPath: Registering %s at priority %i", path, priority);	if (!curSearchPath)	{		searchPathRegistry = tmpSearchPath;		searchPathRegistry->lowerPriority = nullptr;		searchPathRegistry->higherPriority = nullptr;		return;	}	while (curSearchPath->higherPriority && priority > curSearchPath->priority)	{		curSearchPath = curSearchPath->higherPriority;	}	while (curSearchPath->lowerPriority && priority < curSearchPath->priority)	{		curSearchPath = curSearchPath->lowerPriority;	}	if (priority < curSearchPath->priority)	{		tmpSearchPath->lowerPriority = curSearchPath->lowerPriority;		tmpSearchPath->higherPriority = curSearchPath;	}	else	{		tmpSearchPath->lowerPriority = curSearchPath;		tmpSearchPath->higherPriority = curSearchPath->higherPriority;	}	if (tmpSearchPath->lowerPriority)	{		tmpSearchPath->lowerPriority->higherPriority = tmpSearchPath;	}	if (tmpSearchPath->higherPriority)	{		tmpSearchPath->higherPriority->lowerPriority = tmpSearchPath;	}}
开发者ID:perim,项目名称:warzone2100,代码行数:54,


示例19: recvBeacon

static bool recvBeacon(NETQUEUE queue){	int32_t sender, receiver,locX, locY;	char    msg[MAX_CONSOLE_STRING_LENGTH];	NETbeginDecode(queue, NET_BEACONMSG);	    NETint32_t(&sender);            // the actual sender	    NETint32_t(&receiver);          // the actual receiver (might not be the same as the one we are actually sending to, in case of AIs)	    NETint32_t(&locX);	    NETint32_t(&locY);	    NETstring(msg, sizeof(msg));    // Receive the actual message	NETend();	debug(LOG_WZ, "Received beacon for player: %d, from: %d",receiver, sender);	sstrcat(msg, NetPlay.players[sender].name);    // name	sstrcpy(beaconReceiveMsg[sender], msg);	return addBeaconBlip(locX, locY, receiver, sender, beaconReceiveMsg[sender]);}
开发者ID:mikevdg,项目名称:warzone2100-pathing,代码行数:20,


示例20: SetWinTitle

VOID SetWinTitle(HWND hwnd, PATTMAN pam) {   CHAR buf[LPATH + 32];   dprintf("Settaggio titolo finestra/n");   DlgLboxQueryItemText(hwnd, LB_FILE, pam->fsp.psSel[1], buf, LPATH + 32);   // se 
C++ sstrcpy函数代码示例
C++ sstr函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。