C++程序有关问题

来源:百度知道 编辑:UC知道 时间:2024/06/24 14:31:47
#include <stdio.h>
#include <stdlib.h>
#define TURE 1
#define ERROR 0
#define OVERFLOW -2
#define OK 1
typedef int Status;
typedef int ElemType *Triplet;
Status InitTriplet(Triplet &T,ElemType v1,ElemType v2,ElemType v3);
Status DestroyTriplet(Triplet &T);
Status Get(Triplet T,int i,ElemType &e);
Status Put(Triplet &T,int i,ElemType e);
Status Max(Triplet T,ElemType &e);
void main()
{
int e;
InitTriplet(&T,100,200,300);
Get(T,2,&e);
printf("%d",e);
Put(&T,3,150);
Get(T,3,&e);
printf("%d",e);
Max(T,&e);
printf("%d",e);
Min(T,&e);
printf("%d",e);
DestroyTriplet(&T);
}
后面函数没错
请各位高手看看前面总报错!

C/C++/VC爱好者QQ群:12927269
有问题的话,可以帮你解决。

#include <stdio.h>
#include <stdlib.h>
#define TURE 1
#define ERROR 0
#define OVERFLOW -2
#define OK 1
typedef int Status;
typedef int ElemType;
typedef int* Triplet;
Status InitTriplet(Triplet &T,ElemType v1,ElemType v2,ElemType v3);
Status DestroyTriplet(Triplet &T);
Status Get(Triplet T,int i,ElemType &e);
Status Put(Triplet &T,int i,ElemType e);
Status Max(Triplet T,ElemType &e);
void main()
{
int e;
ElemType T;
/*InitTriplet(&T,100,200,300);
Get(T,2,&e);
printf("%d",e);
Put(&T,3,150);
Get(T,3,&e);
printf("%d",e);
Max(T,&e);
printf("%d",e);
Min(T,&e);
printf("%d",e);
DestroyTriplet(&T);
*/
}