Hello,
I'm embarrassed for asking this question but for the life of me I cannot find an answer. This ultra simple code is giving this error as well as any other function that I'm trying to write.
a function-definition is not allowed here before '{' token
expected `,' or `;' before '{' token
I'm using the latest version of bloodshed to compile 4.9.2.2
Here's the code:
#include <iostream>
#include <string>
int main ()
{
// return the greatest common divisor
int gcd(int v1, int v2)
{
while (v2) {
int temp = v2;
v2 = v1 % v2;
v1 = temp;
}
return v1;
}
}
Please help me :(