I am trying to learn c++ and this is what I have come up with. I want to apply email validation and the constraints that I want to put are -
1. first place should have alphabet only.
2. before @ there can be any alphabet, digit, _ or .
3. After @ is detected .com or .co.in should come next.
Is my approach right?
using namespace std;
cout<<"enter your email id: ";
for(unsigned int pos=0; pos<email.size();pos++)
Thanks for replying. Yes I know that my constraints will not accept many of the valid email ids but I need to start from somewhere and hence I thought of starting with this and later I can make changes(first I need to learn how to make code for validation, right?)
I am not supposed to submit this code or use it anywhere, just trying to learn. :)
Can you please help me in correcting the errors? :) I know my code is really stupid and probably of no use. :P