Difficult to say without you giving us the errors. I think one prob is that you are assigning ints directly to chars in operator+, which should lead to some odd and undesired results - something you seem to be aware of since you include the "- '0'" in setNum.
Who're you trying to impress? These sort of compound expressions can confuse anybody that reads it. Instead, break it down to simpler and smaller compound expression statements. Also, add comments to indicate what the expression is for and what it's intended to do.
2) std::cin doesn't accept string objects (not in VC++E '10, at least).
Do the various degrees functionality of your program call for any particular kind of compiler? Or are they used based on a level of preference. Im using the GCC Compiler, just wondering compilers are something that is chosen like choosing a favorite IDE, or certain compilers compliment certain abilities...
Do the various degrees functionality of your program call for any particular kind of compiler?
Generally, it's common to choose a compiler that best suits your project. Some compilers perform better optimizations than others, for example. So yes, I guess it's a personal preference.
AppDevTrainee wrote:
just wondering compilers are something that is chosen like choosing a favorite IDE
It's common to find IDEs such as Code::Blocks, Dev-C++ (apologies for speaking the forsaken IDE's name), and VC++ with a default compiler. Some IDEs, however, can support multiple compilers, such as Code::Blocks.
lol its all good. And thanks i really didnt know that. For now im not developing anything that beckons the use of a different compiler other than GCC. But later in the future when i start developing strong and more specified compilers i will definitely start considering different compilers.
However, on the topic of personal preference, whats the best IDE??
The best IDE for GCC, in my opinion, is Code::Blocks. The best IDE for Microsoft's compiler is Visual C++ Express 2010 (free). I have them both installed; that way, I can test for code compatibility with different compilers.
@danialgood: Integer division returns an integer.
Also string static sum;. ¿do you realise what that means? That string is shared for all the objects.
IIRC string bigNum::sum=0; you are trying to dereference a NULL pointer there.
Later you try to access the string. But you never set it to anything (so, out of bounds)