Unknown Errors in simple program

I have to write a program that implements the selection sort algorithm using recursion. I still have yet to test out my code because I'm getting errors that I don't know how to fix.
I'm using DevCpp (latest version) and I get a bunch of errors in the sort function. I copied the code to VS .NET and it compiled fine. For some reason VC .NET has linker errors with STL_ or some bull crap which is why I use DevCpp. Can anyone else compile this on devcpp? Or know why i'm getting errors?

[Warning] In function `int sort(int*, int)':
parse error before ` =' token
parse error before ` )' token
..a bunch of errors about scope and variables not being declared even though they are. Anyone know wtf is going on?

> for (int i=loc; i<=MAX_ELEMENTS; i++)
Should just be i < MAX_ELEMENTS. You're hitting memory you don't own otherwise.

Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah

You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie

That was an issue (I might have caught it if I were able to run the program). However, it is legal in c++ and doesn't cause any of the compilation errors I get. I changed it and still get the same problems.

It compiles fine for me using GCC3.3 and Gentoo Linux. I'd blame the compiler.

Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah

You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie

There aren't any syntactic errors in your code, however, aside from the point, I would like to point out that when your functions say they return something, they really should return something (such as in int main() and int sort()).

Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah

You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie

I probably would've fixed all those problems (I recognize myself as someone who makes those mistakes but ends up cleaning up the code and fixing that stuff regularly) but I can't test the program because neither DevCpp or VS .NET are working. wtf man, not pie

In that case, could you copy all of the error messages from Dev-Cpp into a post please?

Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah

You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie

C:/Documents and Settings/christopher/Desktop/pa4a.cpp: In function `void
selsort(int*, int)':
C:/Documents and Settings/christopher/Desktop/pa4a.cpp:24: parse error before `
=' token
C:/Documents and Settings/christopher/Desktop/pa4a.cpp:29: parse error before `
)' token
C:/Documents and Settings/christopher/Desktop/pa4a.cpp: At global scope:
C:/Documents and Settings/christopher/Desktop/pa4a.cpp:35: ISO C++ forbids
declaration of `tmp' with no type
C:/Documents and Settings/christopher/Desktop/pa4a.cpp:35: `array' was not
declared in this scope
C:/Documents and Settings/christopher/Desktop/pa4a.cpp:35: `loc' was not
declared in this scope
C:/Documents and Settings/christopher/Desktop/pa4a.cpp:36: `loc' was not
declared in this scope
C:/Documents and Settings/christopher/Desktop/pa4a.cpp:36: ISO C++ forbids
declaration of `array' with no type
C:/Documents and Settings/christopher/Desktop/pa4a.cpp:36: parse error before `
;' token
C:/Documents and Settings/christopher/Desktop/pa4a.cpp:37: `locsmall' was not
declared in this scope
C:/Documents and Settings/christopher/Desktop/pa4a.cpp:37: ISO C++ forbids
declaration of `array' with no type
C:/Documents and Settings/christopher/Desktop/pa4a.cpp:37: assignment (not
initialization) in declaration
C:/Documents and Settings/christopher/Desktop/pa4a.cpp:38: `array' was not
declared in this scope
C:/Documents and Settings/christopher/Desktop/pa4a.cpp:38: `loc' was not
declared in this scope
C:/Documents and Settings/christopher/Desktop/pa4a.cpp:38: ISO C++ forbids
declaration of `selsort' with no type
C:/Documents and Settings/christopher/Desktop/pa4a.cpp:38: `int selsort'
redeclared as different kind of symbol
C:/Documents and Settings/christopher/Desktop/pa4a.cpp:19: previous declaration
of `void selsort(int*, int)'
C:/Documents and Settings/christopher/Desktop/pa4a.cpp:38: initializer list
being treated as compound expression
C:/Documents and Settings/christopher/Desktop/pa4a.cpp:39: parse error before `
}' token
Execution terminated

Now can you post the code you're compiling, because you've obviously changed some things from the original code you posted.

Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah

You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie

Try changing the 'small' variable to something else, and see what happens then.

Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah

You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie