Bignum Challenge 2

here is my big integer library:
#include <iostream>

using namespace std;

int main(int argc, char **argv)
{

}

class BigNum
{
char Num1[16]="100000000000000";
char Num2[16]="100000000000000";

char Add[10]="Num1+Num2";

char Num3[10]="111111111";
char Num4[10]="100100100";

char Subtract[10]="Num3-Num4";

char Num5[101]="99999999";
char Num6[101]="99999999";

char Multiply[10]="Num5*Num6";

char Num7[16]="400000000000000";
char Num8[16]="500000000000000";

char Divide[10]="Num7/Num8";

char Num9[26]="1000000000000000000000000";
char Num10[25]="200000000000000000000000";

char Modulo[11]="Num9%Num10";
};

I want to see if anyone can come up with
a shorter version of their code they
submitted during the time of the
original: http://www.cplusplus.com/forum/lounge/32041
Last edited on
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#include <iostream>

using namespace std;

int main(int argc, char **argv)
{

}

class BigNum
{
char Num1[16]="100000000000000";
char Num2[16]="100000000000000";

char Add[10]="Num1+Num2";

char Num3[10]="111111111";
char Num4[10]="100100100";

char Subtract[10]="Num3-Num4";

char Num5[101]="99999999";
char Num6[101]="99999999";

char Multiply[10]="Num5*Num6";

char Num7[16]="400000000000000";
char Num8[16]="500000000000000";

char Divide[10]="Num7/Num8";

char Num9[26]="1000000000000000000000000";
char Num10[25]="200000000000000000000000";

char Modulo[11]="Num9%Num10";
};

Ugh..I don't think that is the way the big number libraries work.

The main function is empty even if the class did work but it does nothing.
Last edited on
Um... BigNum.Add would do nothing. Its a character array. After reading the challenge, this does none of the things it asks.
Topic archived. No new replies allowed.