I don't get any compile errors so hopefully that means it's right
If the compiler doesn't complain, it doesn't always mean there's nothing wrong.
ausairman wrote:
But then how do I define the function inside main()?
You can't define a function within another function. You need to either define the function body at the point of declaration, or define the body after main( ).