>> I will try this way..Thanks very much...
Erm, that won't do what you want it to do. That only stores 2001 values, ranging from -1000 to +1000.

>> it will automatically change to type in these ranges...
You can use the modulus operator:

std::cout<< 1253215%1001;

Make a class that stores two values, a real and an imaginary one. use the modulus operator to make sure their ranges are within the right values and you have it really.