I am just new to c++ prog but i did this as my project with help
the problem i am having is a linker error so if anyone could solve it it would help
THANKS
it say cannot link
[Linker error] undefined reference to `Auth()'
[Linker error] undefined reference to `Passchange()'
[Linker error] undefined reference to `Userchange()'
[Linker error] undefined reference to `Members()'
You cannot define functions inside other function, that is you cannot define
Auth, Passchange, Userchange, Mebers functions inside main function. You should define them outside of main, then call them from main.
When adding a new function yu have three seperate and very important steps. You have to forward declare the function, invoke it and define it. At the moment your program is invoking and defining the functions but not forward declaring them.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
#include <iostream>
using std::cout;
using std::endl;
//forward declaration
void MostAwesomeFunction();
int main()
{
//invokation
MostAwesomeFunction();
}
//function definition
MostAwesomeFunction()
{
cout << "This is such an awesome function!" << endl;
}
The main function is the starting point for any and all c++ programs and so does not need to be invoked or forward declared, you just define it. Also it is bad practise to invoke the main function as you have in your program. Instead use techniques to control the flow of the progam such as conditional statements and loops.
Since this is such a basic concept I suggest you read up and practise using functions in your programs and then come back to this example and try and fix it yourself.