![]() |
#2
huaijuliu2012-03-24 07:23
|

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
typedef struct
{
double hx;
int nx;
} Level;
typedef struct
{
Level *Lk;
} Stack;
void initialize(Stack *V, int nx0)
{
Level *L;
V->Lk=(Level *)calloc(1,sizeof(Level));
L=V->Lk+1;
L->hx=nx0/2;
L->nx=nx0;
printf("\n level: nx=%d hx=%f",L->nx,L->hx);
}
void init_p(Stack *V, int c)
{
Level *L;
L=V->Lk+c;
printf("\nnx is %d",L->nx);
printf("\nhx is %d\n",L->hx);
}
void main()
{
Stack V;
initialize(&V,5);
init_p(&V,1);
}
#include <stdlib.h>
#include <math.h>
typedef struct
{
double hx;
int nx;
} Level;
typedef struct
{
Level *Lk;
} Stack;
void initialize(Stack *V, int nx0)
{
Level *L;
V->Lk=(Level *)calloc(1,sizeof(Level));
L=V->Lk+1;
L->hx=nx0/2;
L->nx=nx0;
printf("\n level: nx=%d hx=%f",L->nx,L->hx);
}
void init_p(Stack *V, int c)
{
Level *L;
L=V->Lk+c;
printf("\nnx is %d",L->nx);
printf("\nhx is %d\n",L->hx);
}
void main()
{
Stack V;
initialize(&V,5);
init_p(&V,1);
}