I'm having issues with a program I'm developing for a class. It is a Lucas Number calculation program that requires a pipe and fork to be used. The source code for the file can be found at <link removed>
Can anyone help me out? here's the output I'm getting:
Create the pipe
Enter a number: 10
Create the child process using fork
parent is running...
about to write to the pipe
after writing to the pipe
child is running...
about to read from the pipe
after reading from the pipe
the value of n is: 10
the value in the buffer is: Writing to
fib( 0) = 0
Calculating...elapsed time = 8
fib( 1) = 1072693248
Calculating...elapsed time = 9
fib( 2) = 1072693248
Calculating...elapsed time = 10
fib( 3) = 1073741824
Calculating...elapsed time = 11
fib( 4) = 1074266112
Calculating...elapsed time = 12
fib( 5) = 1075052544
Calculating...elapsed time = 13
fib( 6) = 1075838976
Calculating...elapsed time = 14
fib( 7) = 1076494336
Calculating...elapsed time = 15
fib( 8) = 1077215232
Calculating...elapsed time = 16
fib( 9) = 1078001664
Calculating...elapsed time = 17
{cs1:~/unix} fib(10) = 1078689792
I admit I'm a total noob to C so any help would be greatly appreciated. The program is compiled on a Sun Solaris server and is running there. Here's the definition for lucas numbers: http://en.wikipedia.org/wiki/Lucas_prime
Thank you!