我正在尝试将字符串与数字(双)值和文本连接起来。
我当前的代码:
char nameLed[256]; //Nom de la led
char colorLed[256]; //La couleur de la led
char I_directLed[100]; //L'intensité direct que peut supporter la led
double U_directLed; //La tension direct que peut supporter la led
char commentLed[256]; //Le commentaire sur la led
char chaineSaveLed[1000];//Chaine concaténé
GetCtrlVal(panel, TABPANEL_1_ST_Name, nameLed); //Panel > Tab Champ
GetCtrlVal(panel, TABPANEL_1_ST_Color, colorLed); //Panel > Tab Champ
GetCtrlVal(panel, TABPANEL_1_I_Direct_Led, &I_directLed); //Panel > Tab Champ
GetCtrlVal(panel, TABPANEL_1_U_Led_Direct, &U_directLed); //Panel > Tab Champ
GetCtrlVal(panel, TABPANEL_1_TXT_Comment, commentLed); //Panel > Tab Champ
//Créer la chaine à enregistrer au format CSV
//Concaténation de chaine
strcat (chaineSaveLed, nameLed);
strcat (chaineSaveLed, ",");
strcat (chaineSaveLed, colorLed);
strcat (chaineSaveLed, ",");
strcat (chaineSaveLed, I_directLed);
strcat (chaineSaveLed, ",");
strcat (chaineSaveLed, U_directLed);
strcat (chaineSaveLed, ",");
strcat (chaineSaveLed, commentLed);
strcat (chaineSaveLed, "/n");
printf ("%s\n", chaineSaveLed);
我的问题出在“I_directLed”和“U_directLed”上。
我必须将双精度转换为字符。
谢谢你的帮助。