mardi 17 janvier 2023

ld returned 1 exit status in C++ [closed]

I am running this code for several hour but getting error "ld returned 1 exit status". Problem actually lye in function which are on the top nd switch which I have used at the end.

Actually it program which will preform a task of registration , login and forgot password.

#include <iostream>
#include <fstream>
#include <string>
using namespace std;

void login();
void registration();
void forgot();

int main(){
    
    int c;
    
    cout<<"\t\t\t___________________________________________________________\n\n\n";
    cout<<"\t\t\t                     WELCOME TO LOGIN PAGE                 \n\n";
    cout<<"\t\t\t___________________________ MENU ___________________________\n";
    cout<<"                                                                    \n\n";
    cout<<"\t\t\t | Press 1 to LOGIN                         |"<<endl;
    cout<<"\t\t\t | Press 2 to REGISTER                      |"<<endl;
    cout<<"\t\t\t | Press 2 to if you forgot your PASSWORD   |"<<endl;
    cout<<"\t\t\t | Press 4 to EXIT                          |"<<endl;
    
    cout<<"\n\t\t\t Please enter your choice: ";
    cin>>c;
    
    switch(c){
        case 1:
            login();
            break;
        case 2:
            registration();
            break;
        case 3:
            forgot();
            break;
        case 4:
            cout<<"Thank You!";
            break;
        default:
            cout<<"Invalid Input";
    }
    
    
    
    
}

Aucun commentaire:

Enregistrer un commentaire