I’m working on a project to implement multi-precision arithmetic in C++. I’ve sort of fallen at the first hurdle. I’m trying to convert a c-string into the binary representation of an integer that will probably contain more bits than an int can hold (this may be an arbitrary number of bits in theory). I essentially want to create an array of longs that will hold the binary representation of the number contained in the string, with index 0 being the least significant “limb” of the number. I am assuming that the number is in base ten.
I have already looked into using code from GMP but it is needlessly complex for my needs and has huge amounts of platform dependent code.
Any help would be great! If you require more details let me know.
Like @SteveJessop said