I can't test it, and the documentation is a bit vague, but there's a method with this signature:
int zkcm class::get_prec ( void ) const;
Which is described like so:
Get the internal precision of the object, namely, the precision used for each part of "this" complex number
This might return the number of digits, which should be proportional to the amount of memory used. Of course the exact relationship is an implementation detail. The class itself probably just holds a pointer to a heap-allocated buffer where the digits live and some bookkeeping information. The sizeof
operator (in C++) is fully static, i.e. evaluated at compile-time.