ok
i got what u r trying to explain

now problem is since i am writing in file from main() hence i cant write each data member individually

can u suggest any other approach

thank you