Recursive function gives undefined reference bug
The following section of my code is giving me problems (cout statements removed to save space):
Code:
int CSP;
void allocatecsp (); {
cin >> CSP;
cin >> sws;
CSP = CSP - sws;
cin >> axs;
CSP = CSP - axs;
cin >> sps;
CSP = CSP - sps;
cin >> bos;
CSP = CSP - bos;
cin >> shs;
CSP = CSP - shs;
int cspreallocate;
if (CSP > 0) {
cin >> cspreallocate;
if (cspreallocate = 0) {
allocatecsp (); // ********************
}
}
else if (CSP < 0) {
allocatecsp (); // ********************
}
else {
cin >> cspreallocate;
if (cspreallocate == 0) {
allocatecsp (); // ********************
}
}
}
When I try to compile, it returns "undefined reference to 'allocatecsp()'" error in the lines marked with stars. Any idea why this would be (all variables not declared here are declared above the top)?