Couple of remarks. First, the header file cannot be included without first doing:
Code:
#include <string>
using namespace std;
Your header file should #include <string> itself. However, it should not do a using namespace std; - use std::string.
Your program, while it seems to work with "rols"/numbers (haven't tested this well yet), seems to break std::string. Consider this example:
Code:
#include <string>
#include <iostream>
using namespace std;
#include "rol.h"
int main()
{
rol r;
std::string s1, s2;
r = "123";
s1 = "abc";
s2 = "def";
s1 = s1 + s2;
r = r + s2;
std::cout << s1 << std::endl;
std::cout << r << std::endl;
return 0;
}
Which gives:
When the first line ought to read "abcdef". If you really want to use std::string to hold your numerical data, derive a class from it, name it rol, and get rid of the typedef.
You library appears to write temporary files. (And not clean them up?) Doesn't seem friendly to me, and a library such as rol really shouldn't need file I/O, should it?
Divison by zero locks up in what appears to be an infinite loop.
One of my nitpicks towards libraries of this nature: a*b may be faster than b*a, depending on how I ordered the operands. (In my test, 40 bytes of "123412341..." times "2000" took 1.353s or 0.335s. If it's faster to have one operand on one side, have the function do a length test, and swap operands if needed.
Speed: Finding 100! (factorial) is taking some time...
Finally, aside from your function names being in German(?):
Code:
extern void multiplikation(string,string,string);
I'm going to assume this does multiplication. If so, how does it return an answer? There is no return value, no pointers, no references. (And three arguments?)
My preference is to leave argument names in the header files. This clarifies at a glace what the argument to the functions are.
Otherwise, so far it is getting the correct answers. Well done.