Hey

Imi poate spune si mie cineva ce e gresit la acest cod?
#include<iostream>
#include<fstream>
using namespace std;
fstream f("arbore.txt",ios::in);
struct varf { int inf; varf* fs,*fd;}a[30];
varf *c,*v;
int i,n,st[30],dr[30];
void citire()
{
f>>n;
for(i=1;i<=n;i++)
f>>st[i];
for(i=1;i<=n;i++)
f>>dr[i];}
varf* tree(int nod)
{
if(nod)
{
varf *c=new varf;
c->inf=nod;
c->fs=tree(st[nod]);
c->fd=tree(dr[nod]);
return c;}
else
return 0;}
void preO( varf *c)
{
if(c->inf)
{
cout<<c->inf<<" ";
preO(c->fs);
preO(c->fd);}}
void inO(varf *c)
{
if(c->inf)
{
inO(c->fs);
cout<<c->inf<<" ";
inO(c->fd);}}
void postO(varf *c)
{
if(c->inf)
{postO(c->fs);
postO(c->fd);
cout<<c->inf<<" ";} }
int main()
{ citire();
v=tree(1);
preO(v);
cout<<endl;
inO(v);
cout<<endl;
postO(v);
cout<<endl;
system("PAUSE");
return 0;}
multumesc mult
