Q:

C++: "error: expected ',' or '...' before '(' token"

I've searched around and can't seem to find an answer to an error I'm receiving on a coding project.  I'm trying to create a program that asks a user to enter a name and will then search through the most popular baby names in 2012 to find how common a name it was that year.  However, even though it seems like a pretty common problem, I've run into a problem when defining one of my functions that I can't figure out.  Here's the code so far:

/*Description: The code below asks the user to input a baby name and then
finds the popularity ranking of that name for both boys and girls in the
year 2012.
*/

// INCLUDE DIRECTIVES
#include <iostream>
#include <fstream>
#include <cstdlib>
#include <string>

// FUNCTION DECLARATIONS

std::string nameGet(std::string& userName);
/*PRECONDITION: n.a.
POSTCONDITION: Outputs the name provided by the user*/

int findPosition(std::string userName, int namePosition(0));
/*PRECONDITION: Takes a string variable
POSTCONDITION: Outputs the ranking number of said string variable within
the 2012 list of popular baby names*/

// Main Function
int main()
/*PRECONDITION: n.a.
//POSTCONDITION: Popularity ranking of name according to list of popular 21012
baby names*/
{
    // Local Variables
    std::string userName;
    int boyNamePlace(0), girlNamePlace(0);

    nameGet(userName);

    std::cout << std::endl << userName << std::endl;

    boyNamePlace = findPosition(userName, boyNamePlace);
    girlNamePlace = findPosition(userName, girlNamePlace);

    return EXIT_SUCCESS;
}

// FUNCTION DEFINITIONS

std::string nameGet(std::string& userName){
/*PRECONDITION: n.a.
POSTCONDITION: Outputs the name provided by the user*/

    std::cout << "Enter name (capitalize first letter): ";
    std::cin >> userName;

    return userName;
}

int findPosition(std::string userName, int namePosition(0)){
/*PRECONDITION: Takes a string variable
POSTCONDITION: Outputs the ranking number of said string variable within
the 2012 list of popular baby names*/

    // Local Variables
    std::ifstream babyNames;
    bool nameFound(false);

    //Opens the .txt file
    babyNames.open("babynames2012.txt");
    if (babyNames.fail())
    {
        std::cout << "I/O Stream failure when attempting to open file.";

        return EXIT_FAILURE;
    }

    else
    {
        std::cout << "Success";
    }

    for(namePosition = 0; nameFound == false; namePosition++)
    {

        return 0;

    }

    return namePosition;
}

As you can see, this is still a work in progress, with many cout statements throughout in order to check how far the program will operate without any errors once it compiles.  The error message mentioned in the title appears both in the declaration and the definition of the int function "findPosition".  
I don't know how to run a debugger yet and this is my first time posting, so I'm sorry if the formatting is a bit off.

A:

It is this line:
int findPosition(std::string userName, int namePosition(0));

Were you trying to set a default value for that parameter? If so the correct way of doing it is this:
// Declaration
int findPosition(std::string userName, int namePosition = 0);

// Definition
int findPosition(std::string userName, int namePosition) {
    // ...
}

If you were trying to do something else let me know and i will update my answer accordingly.

