C++ doubt
Posted Date Unknown Saksham Saksham 0 Comment

Ok so i wanted to create a c++ program in order to get the number of users and make unique email ids for all of them but it seems there is something wrong with my program

#include<iostream>
using namespace std;
class Email
{
int age;
long int phno;
char name,dob;
public:
char emailid;
void get_details()
{
cout<<"Enter your name:- "<<endl;
cin>>name;
cout<<"Enter your age:- "<<endl;
cin>>age;
cout<<"Enter your phone number:- "<<endl;
cin>>phno;
cout<<"Enter your Date Of Birth:- "<<endl;
cin>>dob;
cout<<"Enter your Email Id:- "<<endl;
cin>>emailid;
}
};
int main()
{
Email *obj=new Email;
int n,i,j;
cout<<"Enter the number of Users:- "<<endl;
cin>>n;
obj[0].get_details();
for(i=1;i<n;i++)
{
for(j=0;j<i;j++)
{
obj[i].get_details();
if((obj[i].emailid)==(obj[j].emailid))
{
cout<<"An Email Already exists with that Email Id Please Try Again"<<endl;
delete[] obj;
}
}
}
return 0;
}

See All Responses Below...
Author
Message Rating
Posted on:
Please Login to Post Your Comments
Name (Max. 100 characters)
Please post your comments here
Select Language
Comments
   Design  HTML
Attach File(Max. Size: 2 MB)
A few simple rules when posting your Comments,
  1. Please post only answers relevant to the topic of discussion.
  2. Please dont misuse this site or do not be abusive, offensive, inappropriate,harass anyone on the boards or post ads or spam. Doing so will delete your inappropriate messages and will block or delete your account on this site. 

Copyright © KTS Infotech 2000-2023. Site Developed Using KTS WebCloud
Reach Us on facebookWatch Video Tutorials on YouTube Channel TekTipsNavigate to KTS Technology Blog