I'm new to C++.Today I want to write some lines to pick the min data and its index from a array .So I write a function and I use the construct return the result.But some error appears .I can't figure it out .Somebody help me please .Thank you in advance.
Fmin(int arg[],int len) - what's the return type? Should be:
result Fmin(int arg[],int len)
When do you set re.index? Never. You should.
Other issues are that you're using an old style of C++ that many modern compilers will refuse to work with (for example, void main()). This is not a problem unless you ever intend to do any programming with other people or as a job.
Thank you for your answers. It worked after Moschops's suggestion. Yeah I am using the old style but I am learning the new one. The guys around me all use the old one. Just say that they are all out of date. Again thank you!!
You are missing "using namespace std;" after the #include's.
As an aside, the old style iostream.h did not recognise the std namespace, so this is only necessary is one switches to the modern iostream (without the .h).