Please help,
how can I compile this ?
g++ -v
Reading specs from /opt/sfw/gcc-3/lib/gcc-lib/i386-pc-solaris2.9/3.3.2/specs
Configured with: ../gcc-3.3.2/configure --prefix=/opt/sfw/gcc-3 --with-ld=/usr/ccs/bin/ld --with-as=/usr/ccs/bin/as --without-gnu-ld --without-gnu-as --enable-shared
Thread model: posix
gcc version 3.3.2
#include <assert.h> #include <iostream>
#include <Integer.h> // valid for GNU g++
using namespace std;
int main() { int i; int n; Integer product = 1; // unsigned long long int product = 1;
cout << "The factorial of n will be computed.\n" "\n" "Input n: ";
cin >> n;
assert(cin && n >= 0);
for (i = 2; i <= n; ++i) product *= i;
cout << "\n" "factorial(" << n << ") = " << product << "\n" "\n"; }
/*
bash-2.05$ g++ -ansi -pedantic -Wall -o main.out main.c -L /opt/sfw/gcc-3/lib/ -R /opt/sfw/gcc-3/lib/ -lstdc++
main.c:5:53: Integer.h: No such file or directory
main.c: In function `int main()':
main.c:13: error: `Integer' undeclared (first use this function)
main.c:13: error: (Each undeclared identifier is reported only once for each
function it appears in.)
main.c:13: error: parse error before `=' token
main.c:22: error: `product' undeclared (first use this function)
*/
best regards
Morten Gulbrandsen