Can't construct a mpz_class of a string

Daniel L ännström danne_89 at home.se
Wed Jun 9 15:29:16 CEST 2004


The manual is saying: "void mpz_class::mpz_class (const string& s)". Way doesn't this work? mpz_class tal = std::string("12319238"); 

I got this error by GCC: 
problem3.cpp: In function `int main()':
problem3.cpp:49: conversion from `std::string' to non-scalar type `
   __gmp_expr<__gmpz_value, __gmpz_value>' requested

Does anybody knows what I'm doing wrong? And I know that my english sucks. :)

// Danne
-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GCS d- s+:+ a---- C++++ UL++++ P+++ L+++ E- W++ N-- o-- K-- w---
O---- M-- !V PS++ PE+++ Y-- PGP- t+++ 5-- X-- R++ tv+ b+++ DI+ D---
G e++++ h! !r !y+
------END GEEK CODE BLOCK------


More information about the gmp-discuss mailing list