hi im writing a little program for myself so i can get used c++.
i made a structure to hold the data then i tried to make a function that would creat a new struct for each new card (void direct)
as you can imagine the way i tried isnt working.
any sugestions?
here are some line i made..
test is the struct itself
create() gathers the name and stuff...
direct() puts the info in the structure.
struct test // structure of the cards
{
char fname[15];
char lname[15];
int age[2];
int tel[12];
int bdate[8];
};
void create() // gather info and put them into cards
{
cout <<endl<< "Enter first name :"<<endl;
cin >> temp[0];
cout <<endl<< "Enter last name :"<<endl;
cin>>temp[1];
cout <<endl<< "Enter age :"<<endl;
cin>>temp[2];
cout <<endl<< "Enter birth date (DD/MM/YY) :"<<endl;
cin>>temp[3];
cout <<endl<< "Enter phone number :"<<endl;
cin>>temp[4];
direct();
cout <<endl<< "card created!" <<endl<< endl;
}
void direct() // put info from create() into struct test
{
char name[15];
name = temp[1];
test name;
name.fname = temp[0];
name.lname = temp[1];
name.age = temp[2];
name.bdate = temp[4];
name.tel = temp[3];
}
thx in advance..
luigi



LinkBack URL
About LinkBacks



