another option for static variable in file handling
i dont want to use static variable.....i want to use the detail written in file..how can i enter details of more than 2 employees???
void reading(FILE *); int main() { double tax;char ans;double savings=100000; FILE *fp;int a;int id; cout<<"\n\n\n\n\n e - TAX return calculator !!! \n"; cout<<" ...............................\n"; cout<<" ...............................\n"; a=getch(); if(a!=0) system("cls"); cout<<"ENTER EMPLOYEE ID : ";cin>>id;cout<<"\n\n"; if(id==101101) { fp=fopen("employee1.txt","r"); reading(fp); cout<<"\nDO YOU WANT TO CALCULATE THE TAX ??? (y/n) "; cin>>ans; if(ans=='y') { double sal=650000; cout<<"\nSAVINGS DEDUCTED : 100000\n"; double non_sav=sal-savings; if(non_sav<180000) cout<<"\nNO TAX\n"; if(non_sav>180000 && non_sav<500000) cout<<"\nTAX = "<<(0.1*non_sav)<500000) cout<<"\nTAX = "<<(0.2*non_sav)<>ans; if(ans=='y') { double sal=800000; cout<<"\nSAVINGS DEDUCTED : 200000\n"; double non_sav=sal-savings; if(non_sav<215000) cout<<"\nNO TAX\n"; if(non_sav>215000 && non_sav<500000) cout<<"\nTAX = "<<(0.1*non_sav)<500000) cout<<"\nTAX = "<<(0.2*non_sav)<

void reading(FILE *fp) { char c; c=getc(fp); while(c!=EOF) { putchar(c); c=getc(fp); } fclose(fp); }

another option for static variable in file handling
===

i dont want to use static variable.....i want to use the detail written in file..how can i enter details of more than 2 employees???
void reading(FILE *); int main() { double tax;char ans;double savings=100000; FILE *fp;int a;int id; cout<<"\n\n\n\n\n e - TAX return calculator !!! \n"; cout<<" ...............................\n"; cout<<" ...............................\n"; a=getch(); if(a!=0) system("cls"); cout<<"ENTER EMPLOYEE ID : ";cin>>id;cout<<"\n\n"; if(id==101101) { fp=fopen("employee1.txt","r"); reading(fp); cout<<"\nDO YOU WANT TO CALCULATE THE TAX ??? (y/n) "; cin>>ans; if(ans=='y') { double sal=650000; cout<<"\nSAVINGS DEDUCTED : 100000\n"; double non_sav=sal-savings; if(non_sav<180000) cout<<"\nNO TAX\n"; if(non_sav>180000 && non_sav<500000) cout<<"\nTAX = "<<(0.1*non_sav)<500000) cout<<"\nTAX = "<<(0.2*non_sav)<>ans; if(ans=='y') { double sal=800000; cout<<"\nSAVINGS DEDUCTED : 200000\n"; double non_sav=sal-savings; if(non_sav<215000) cout<<"\nNO TAX\n"; if(non_sav>215000 && non_sav<500000) cout<<"\nTAX = "<<(0.1*non_sav)<500000) cout<<"\nTAX = "<<(0.2*non_sav)<

void reading(FILE *fp) { char c; c=getc(fp); while(c!=EOF) { putchar(c); c=getc(fp); } fclose(fp); }
