: : About all your program can check is the presence of '@' and spaces. Otherwise the only way I know of to validate an email address is to send an email to it and get a reply.
: :
: : And you better study pointers before you do that or else you will be completly lost and over your head.
: :
: : Also, never use gets() because it causes too many problems. use fgets() instead, like this example
: :
: : char iobuf[80];
: : fgets(iobuf, sizeof(iobuf), stdin);
: :
: :
: well thanx but im bound to do it without pointers because my teachers hasnot taught pointers till yet and he told to use gets()
:
can we do this way?
char id[30];
l=strlen(id);
// take input..
int flag1=0,flag2=0;
for(int i=0;i<l;i++)
{
if(id[i]=='@')
flag1=0;
if(id[i]=='.')
flag2=0;
}
if(flag1&&flag2)
printf("Valid");
else
printf("Invalid.");