Defination of Class Database is right above this function.
i am getting this error.
1 2 3
In file included from main.cpp:6:0:
database.cpp: In function ‘void create_database(std::string, std::string)’:
database.cpp:63:10: error: declaration of ‘Database A’ shadows a parameter
This means that there already is an object named A (i.e. the input string object, which is named A). Rename the Database object to something not already used.
But thats what i want. I want to take name of database as input, pass it as parameter in function create_database. And then declare a database name that variable!
I successfully managed to use filename as variable like below, but can't do the same for database name.
See how filename now "shadows" just like A, this is what Moschops is saying. You named the ifstream "input", as Moschops has stated why not give it a different name, heck even databaseA would work if you "need" the A.