小编Fin*_*ers的帖子

在 C 中将浮点数传递给字符串

如何将变量添加到字符串中?我想传输具有实际值的字符串depth。那么如何将其添加到消息中呢?

float depth = ((pressure) / (g)) * 100;
char message[] = "$DBS,,f,depth,M,,,F*hh<CR><LF>";  //Put actual depth here
Run Code Online (Sandbox Code Playgroud)

c string

2
推荐指数
1
解决办法
141
查看次数

标签 统计

c ×1

string ×1