#includeint main() { Json::Value myValue = "42.5"; double myNumber = myValue.asNumber(); return 0; }
#includeIn this example, we create a JSValue object with the value 42 (which is an int), and then use asNumber() to retrieve it as a double. The resulting value of myNumber will also be 42. The package library being used in these examples is JsonCpp.int main() { Json::Value myValue = 42; double myNumber = myValue.asNumber(); return 0; }