
03.12.2007, 20:05
|
|
Постоянный
Регистрация: 04.11.2007
Сообщений: 303
С нами:
9746420
Репутация:
119
|
|
nc.STRIEM, вот так?
Код:
#include <stdio.h>
#include <string.h>
#define SIZE 100
struct tel_book
{
char fam[SIZE];
char name[SIZE];
char otc[SIZE];
char num[SIZE];
char addr[SIZE];
}
main(/*int argc, char *argv[]*/)
{
struct tel_book people;
FILE *fp;
gets(people.fam);
strcat(people.fam, " ");
gets(people.name);
strcat(people.fam, people.name);
strcat(people.fam, " ");
gets(people.otc);
strcat(people.fam, people.otc);
strcat(people.fam, " ");
gets(people.num);
strcat(people.fam, people.num);
strcat(people.fam, " ");
gets(people.addr);
strcat(people.fam, people.addr);
fp = fopen("tel.dat", "a");
fprintf(fp, "%s\n", people.fam);
}
я со структурами еще не работал =(
|
|
|