https://docs.google.com/document/d/1g2RN0y2gm_-wsCdUFLFLFVf8ckdqLPndkZZXKboZ9YU/edit
binfa.h:
#ifndef BINFA_H_INCLUDED
#define BINFA_H_INCLUDED
#include <iostream>
typedef char TElem;
struct BinFaElem;
typedef BinFaElem* BinFa;
struct BinFaElem {
TElem ertek;
BinFa bal;
BinFa jobb;
};
void EgyElemuFa(BinFa &f, const TElem e);
#endif // BINFA_H_INCLUDED
binfa.cpp:
#include "binfa.h"
void EgyElemuFa(BinFa &f, const TElem e){
f = new BinFaElem;
//(*f).ertek = e; // ugyanaz mint az alatta levo
f->ertek = e;
f->bal = NULL;
f-> jobb = NULL;
}
main.cpp:
#include <iostream>
#include "binfa.h"
using namespace std;
int main(){
BinFa f = NULL, f2, f3;
EgyElemuFa(f, 'a');
EgyElemuFa(f2, 'b');
EgyElemuFa(f3, 'c');
f->bal = f2;
f->jobb = f3;
return 0;
}