The error you're getting is because you're missing an ending curly bracket off your
m_men function.
Since the m_men function doesn't end properly, when you #include the header file in your main program, the compiler sees you trying to define
int main() as part of the m_men function.
Your real problem is that your code's formatting is misleading (Remember that indentation is for your benefit only, not the compiler's). If you use a consistent indenting style throughout your code, then these errors become far easier to see.
I found the error in a few seconds by using my IDE's auto-indent feature. If your IDE doesn't let you auto-indent, then you may wish to find a text editor or other IDE which does - failing that, be disciplined and take time to line up all your brackets when you're writing code. This way you can clearly see the beginning and end of different blocks.
eg,
CODE
void func()
{
for( int i=0; i<10; ++i )
{
if( i % 2 == 0 )
{
std::cout << "Even number: " << i;
}
}
}
This post has been edited by Bench: 2 Feb, 2008 - 02:05 AM