Ruv*_*una -3 c printf type-conversion
我有这两个变量C:
double predict_label = 6.0;
double prob_estimates = 8.0;
如何将这两个变量转换C为char并打印出一个字符串,其中包含"预测标签的值为6,概率估计值为8"的字符串.
我不认为你想要转换为char,因为你想打印整数值.假设,这应该足够了:
printf("predict label is %d and probability estimates is %d\n",
       (int)predict_label, (int)prob_estimates);