It wasn't work properly as I want it to work .. According to my thinking,code which is given below is always true i don't know why but if-condition always true and number got matched .. Variable named as CNIC was globally declared like this(char CNIC[15])..
  private:
     char ch;
     char str[256];
     std::fstream file1;
  public:
    void verify()
    {
          cout<<"Enter your CNIC number for verifivation : ";
          for(int i=0;i<15;i++)                    
          {
                   CNIC[i] = getche();
          }
          file1.open("D:\\UOL\\OoP\\Nadra database.txt",ios::in);
          check = false;
          while(!file1.eof())
          {         
                file1.getline(str, 255);     
            if(check = strcmp(str, CNIC) == 0);
                 check=true;
          }
          file1.close();
          if(check)
          {
                 cout<<endl<<"CNIC number matched"<<endl;
                              }
          else
          {
                 cout<<endl<<"CNIC number did'nt match " ;
          }
    }
};
 
     
    