Type Casting problem with QuantLib

Posted by Baptiste Debrabant on
URL: http://quantlib.414.s1.nabble.com/Type-Casting-problem-with-QuantLib-tp4487.html

Hi,


I'm trying to load data from xml files and to use it with Quantlib.

But, I am having a type casting problem.
The fields I load from xml are "string" or "char *", but unfortunately
when I try to cast them to "Real" or "Spread", or any other Quantlib
type... It does not work...


Let me give you a sample:

char * data = "1.22"
Real strike = (Real)"data";

->  error: invalid cast from type ‘char*’ to type ‘QuantLib::Real’


Any help greatly appreciated...

Thanks,

Baptiste.