[CLN-list] how to read string numbers at runtime into cl_I type
Richard B. Kreckel
kreckel at ginac.de
Wed Jul 21 08:11:01 CEST 2010
Joshua Friedman wrote:
> In the manual it says: cl_I order_of_rubiks_cube_group =
> "43252003274489856000";
> so I declared a string, S, read it from a file, and then I said
>
> cl_I = S;
> I also tried cl_I = cl_I(S),
>
> but it did not work. I assume because the string is dynamic there is a
> problem. I could not find the correct function or class constructor that
> takes a string.
>
> Here is the error:
> In function ‘int main(int, char**)’:
> e.cc:75: error: conversion from ‘std::string’ to non-scalar type ‘cln::cl_I’
> requested
> make: *** [e.o] Error
Use the member function c_str() of class std::string to convert it to a
const char*.
-richy.
--
Richard B. Kreckel
<http://www.ginac.de/~kreckel/>
More information about the CLN-list
mailing list