为什么没有结果呀?
#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
#define LIST_INIT_SIZE 32
#define LISTINCREMENT 10
struct Stu {
float chinese;
float english;
float database;
float math;
};
typedef struct {
Stu *elem;
int length;
int listsize;
}StuList;
void ScanScore( Stu &L ) {
printf("chinexe:");
scanf("%f",&L.chinese);
printf("\nenglish:");
scanf("%f",&L.english);
printf("\ndatabase:");
scanf("%f",&L.database);
printf("\nmath:");
scanf("%f",&L.math);
printf("\n");
}
int InitList_Stu ( StuList &L ) {
L.elem = ( Stu * )malloc( LIST_INIT_SIZE * sizeof( Stu ));
if( !L.elem ) exit( -2 );
L.length = 0;
L.listsize = LIST_INIT_SIZE;
return 1;
}
int main ()
{
Stu a ;
ScanScore( a );
StuList b;
b.elem = &a;
printf("%f",b.elem);
free( b.elem );
return 1;
}