1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
|
#include <cstdlib>
#include <iostream>
using namespace std;
struct tchr
{
char tname[100], tfield[100], tm[100];
int tcode;
};
void inserttchr(char*,char*, char*, int, struct tchr*);
int main(int argc, char *argv[])
{
struct tchr t[100];
char tn[100], tf[100] ,tm[100];
int i,tcode;
for(i=0;i<100;i++)
{
gets(tn)
gets(tf)
gets(tm)
scanf("%d",&tcode)
inserttchr(tn ,tf, tm, tcode, &t[i]);
}
system("PAUSE");
return EXIT_SUCCESS;
}
void inserttchr(char *n,char *f, char *m, int code, struct tchr* pEntry)
{
strcpy(pEntry->tname,n);
strcpy(pEntry->tfield,f);
strcpy(pEntry->tm,m);
pEntry->tcode = code;
getch();
}
|