In findNum(), I use a loop to test for characters(Each alphabetical character is represented by a number), and if they aren't characters, I try to use main() again.
The problem: to use function findNum() I have to declare it before main(), and to use main(), I have to declare it before findNum(). Got any tips on how to use main() in a function which is used by main()?
// cAt = character At. aNum = the number which each alphabetical
//character represents: A-Z 65-90, a-z 90-122, _=32, " "=95
int findNum(){ int i=0; int cAt, lengthOf, aNum;
while(i<myName.length()){
cAt=myName.at(i);
aNum=myName.at(i);
lengthOf=myName.length();
loop:
if(cAt>=65 || cAt<=90){
i++;
goto loop;}
elseif(cAt>=97 || cAt<=122){
i++;
goto loop;}
elseif(cAt>90 && cAt<97){
if(!cAt==95)cout<<"Please enter a valid name"<<main();
}
elseif(cAt<65 && !cAt==32)cout<<"Please enter a valid name"<<main();
elseif(cAt>122)cout<<"Please enter a valid name"<<main();
elseif(cAt==lengthOf){break;}
}}
int main(){
yourName();
cin.ignore(); //When the enter button gets pressed, this keeps the program
findNum(); // from shutting down.
cin.get(); //This keeps the program open after start-up.
return 0;
}