I wasn't sure what forum to put this in. Well, when I compiled my program in wine, and run it everything worked. But when I compiled it in Linux it the Fibonacci part of my program didn't work. Sometimes it would say nothing and sometimes it says "Segmentation fault" where the numbers were supposed to be.
Wine:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
me@mycomputer:~/wine/bin/$ wine g++.exe /home/me/homework/ass4.cp -o /home/me/homework/ass4.exe
me@mycomputer:~/homework$ wine ass4.exe
The highest common divisor of 43 and 5 is 1
The highest common divisor of 56 and 4 is 4
The highest common divisor of 15 and 5 is 5
The highest common divisor of 90 and 30 is 30
The highest common divisor of 8 and 2 is 2
First Twenty Fibonacci numbers
0 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 2584 4181
Linux:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
me@mycomputer:~/homework$ g++ ass4.cp -o ass4.out
me@mycomputer:~/homework$ ./ass4.out
The highest common divisor of 43 and 5 is 1
The highest common divisor of 56 and 4 is 4
The highest common divisor of 15 and 5 is 5
The highest common divisor of 90 and 30 is 30
The highest common divisor of 8 and 2 is 2
First Twenty Fibonacci numbers
Segmentation fault
No, I still get the same problem. It's ok though as long as it works in Dev C++. It's just odd that it works with Windows' version of gcc, but not Linux's version.