简体   繁体   中英

how to convert long double to string format in Xcode ? or how to solve error “use of undeclared identifier 'to_string' ”

this code works in microsoft visual c++, but when i run this in Xcode, it give me error No member named 'to_string' in namespace 'std'

double learningRates[] = {0.00015, 0.00065, 0.00075, 0.0015, 0.0045, 0.0065, 0.0075, 0.055};

long double learning_Value = learningRates[learningRate_Index];

string pathtotal_weight_Bias= pathWeightBias +"/" + "best_weight_Bias" + convertInt(MaxEpochs) +"_LR"+ to_string(learning_Value)+".xml";

even if i used std::to_string(learning_Value), even than it gives the same error.

Kindly guide me in this regards. thanks

我认为stringWithFormat可能会解决问题:

        NSString *string = [NSString stringWithFormat:@"%d/best_weight_Bias%d_LR%Lf.xml", pathWeightBias, MaxEpochs, learning_Value];

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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