#include <iostream>
#include <conio.h>
#include <stdio.h>
#include <windows.h>
int digit = 0;
using namespace std;
struct fata{
char *name;
char *family;
char *state;
char *city;
int age;
}user[100];
void add();
void Delete(){}
void show(){}
void Gets(char *s){
char v;
int h=0;
if(s[0]=='\0'){
while(1){
v=getche();
if(v==13)
break;
if(v<=90&&v>=65)
v+=32;
s[h++]=v;
}
cout<<endl;}
else if(s[0]!='\0'){
for(int i=0;s[i];i++){
s[i]='\0';
}
Gets(s);
}
}
void _continue()
{
int c;
clrscr();
printf("\n\tPress number 1 to add new user");
printf("\n\tPress number 2 to delete the user");
printf("\n\tPress number 3 to show list of users");
printf("\n\tPress number 4 to Exit");
printf("\n\tEnter number : ");
scanf("%d",&c);
//Start of switch(c)
switch(c)
{
case 1:
add();
break;
case 2:
Delete();
break;
case 3:
show();
break;
case 4:
exit(1);
break;
default:
printf("\n\tYour entered number is not true\
\n\tPress any key to continue.");
getch();
clrscr();
_continue();
break;
}// End of switch(c);
clrscr();
_continue();
}//end of _continue();
//start of add()
void add()
{ clrscr();
kb(1);
printf("\t\tEnter user's name: ");
// تا اینجا مشکلی نست ولی به اینجا که میرسه ارور میده.
Gets(user[digit].name);
printf("\t\tEnter user's family: ");
Gets(user[digit].family);
printf("\t\tEnter user's age: ");
scanf("%d",user[digit].age);
printf("\t\tEnter user's city: ");
Gets(user[digit].city);
printf("\t\tEnter user's state: ");
Gets(user[digit].state);
digit++;
printf("\n\t\tEnter any key to continue ...");
getch();
printf("\n\t\tNEW USER ADDED SUCCESSFULLY.");
getch();
_continue();
}//End of add()
int main()
{
printf("\n PRESS ANY KEY TO CONTINUE ... ");
getch();
_continue();
getch();
return 0;
}