简体   繁体   English

有没有办法在CAPL中将整数转换为char?

[英]Is there a way to convert integer to char in CAPL?

I try to write a integer variable into a file by using the filePutString() function in CAPL. 我尝试使用CAPL中的filePutString()函数将整数变量写入文件。 Is there a way to convert the integer into char, since filePutString() only uses chars as parameter. 有没有一种方法可以将整数转换为char,因为filePutString()仅使用char作为参数。

I suppose the best way would be to use snprintf. 我想最好的方法是使用snprintf。

char buffer[100];
int number = 10;
snprintf(buffer, elcount(buffer), "Text: %d", number);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM