circle problem

This is a discussion on circle problem within the C++ Programming forums, part of the General Programming Boards category; Hello all,
I have tried unsuccessfully to create program using a header file, implemenation file, document file, and driver program ...

circle problem

Hello all,
I have tried unsuccessfully to create program using a header file, implemenation file, document file, and driver program that compute the area of a circle given only the radius. I was told to use the header file for the function header only and the implementation file for the actual code. Can someone explain to me what I did wrong. Here is the code;
header file.h

"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell

"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell

Yes, I keep forgetting that. Using gcc, it doesn't complain when I forget to put in the std::. I think I read something about the <c*> include files putting everything in both the global and std namespaces for now, or is it just gcc doing that?

"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell

I appreciate u explaining it to me. I was unsure as to why i would compile the 2 .cpp together when one is user activated by inputing a radius and the other had fixed values i didnt know that I could do that thanks again.

Originally Posted by QuestionC

Understand that the header/implementation/driver distinction is really of importance for larger programs. Headers and implementation are generally seperated for compiling efficiency.

You appear to be confused on terms. Here is a very bare-bones 3-file program which converts between temperature formats.