Код: Выделить всё
#include "stdafx.h"
#include <stdio.h>
#include <conio.h>
#include <malloc.h>
#include <stdlib.h>
struct fond{
char fio[40];
int num;
}list[20];
int n;
void enter(){
register int a;
for(a=0;a<n;a++)
{
printf("Enter fio: \n");
scanf("%s",&p[a]->fio);
printf("Enter num: \n");
scanf("%d",&p[a]->num);
}
}
void print()
{
register int a;
for(a=0;a<n;a++)
{
printf("%d %s %d",a,p[a]->fio,p[a]->num);
printf("\n");
}
}
void main(){
printf(" Skolko?! \n");
scanf("%i",&n);
struct fond *p;
p=(struct fond*)malloc(n*sizeof(fond));
void enter();
void print();
enter(p);
print(p);
getch();
delete(p);
}