N
Nawaz
int search(int &j){
string take,get1,get3;
int f=0;
for(;f!=2{
system("cls");
print();
cout<<"1. For Search"<<endl;
cout<<"2. Go Back"<<endl<<endl;
cout<<"Enter Any Above NO : ";
scanf("%d",&f);
if(f==1){
fstream se;
se.open ("SiS.txt");
se.seekg(0,ios::beg);
int i=0,k=0,h=0,n=0,l=0;
cout<<"Search by NAME Press 0"<<endl<<endl;
cout<<"Search by ID Press 1"<<endl<<endl;
cout<<"Enter NO : ";
scanf("%d",&l);
se.seekg(0,ios::beg);
char ch;
while(!(se.eof())){
se.get(ch);
take[k]=ch;k++;}
take[k]='^';
if (l==0){
cout<<"Enter Name For Search : ";
getline(cin,get3);
getline(cin,get1);
while(take[j]!='^' && get1!='\x0'){
while(take[j]!='^' && get1!='\x0'){
if(get1==take[j]){i+=1;j+=1;break;}
else if (get1!=take[j]){i=0;j+=1;break;}
}}
for(;take[j]!='~';j--){}
int g=j+=1;
while(take[g]!='/'){
for(;take[g]!='?'&& take[g]!='/';g++)
{
cout<<take[g];}
if (take[g]=='/'){cout<<endl<<endl;break;}
cout<<endl;g+=1;}se.close();}
}
when .exe has open and this function would call then in first
iteration of loop "for", the curser is at beginning but after 2nd
iteration it is at end of file so while open ".exe " how i take curser
at beginning .
please answer as soon as possible
and thanks for answer..
string take,get1,get3;
int f=0;
for(;f!=2{
system("cls");
print();
cout<<"1. For Search"<<endl;
cout<<"2. Go Back"<<endl<<endl;
cout<<"Enter Any Above NO : ";
scanf("%d",&f);
if(f==1){
fstream se;
se.open ("SiS.txt");
se.seekg(0,ios::beg);
int i=0,k=0,h=0,n=0,l=0;
cout<<"Search by NAME Press 0"<<endl<<endl;
cout<<"Search by ID Press 1"<<endl<<endl;
cout<<"Enter NO : ";
scanf("%d",&l);
se.seekg(0,ios::beg);
char ch;
while(!(se.eof())){
se.get(ch);
take[k]=ch;k++;}
take[k]='^';
if (l==0){
cout<<"Enter Name For Search : ";
getline(cin,get3);
getline(cin,get1);
while(take[j]!='^' && get1!='\x0'){
while(take[j]!='^' && get1!='\x0'){
if(get1==take[j]){i+=1;j+=1;break;}
else if (get1!=take[j]){i=0;j+=1;break;}
}}
for(;take[j]!='~';j--){}
int g=j+=1;
while(take[g]!='/'){
for(;take[g]!='?'&& take[g]!='/';g++)
{
cout<<take[g];}
if (take[g]=='/'){cout<<endl<<endl;break;}
cout<<endl;g+=1;}se.close();}
}
when .exe has open and this function would call then in first
iteration of loop "for", the curser is at beginning but after 2nd
iteration it is at end of file so while open ".exe " how i take curser
at beginning .
please answer as soon as possible
and thanks for answer..