Count number of lines, words in c++

#include<iostream>
#include<conio.h>
#include<fstream>
using namespace std;

class file
{
      private:
              int count;
   int num;
   string line;
   char c;
    char filename[20];
   public:
          void read_file()
          {
             
    cout << "enter file name you whant to read:" << endl;
   cin >> filename;
    ifstream file;
  
    file.open(filename);
    if(file.is_open())
    {   cout << "\n\n\t\tyour file contain these chararcter::" << endl;
    cout << "-----------------------------------------------" << endl;
                      while(getline(file,line))
                    
                      {
    cout << line << endl;
                      }
                  
                    
    file.close();

}
}
void count_Size()
{
     ifstream file;
     file.open(filename);
    if(file.is_open())
    {   cout << "\n\n\t\tyour file contain Number of character::" << endl;
    cout << "-----------------------------------------------" << endl;
                      while(getline(file,line))
                    
                      {
 count +=line.length();
  
                      }
                    cout << "number of characters :" << count  << endl;
                    
    file.close();

}
 }
 void count_Lines()
{
      ifstream file;
     file.open (filename);
while (file.good())
{
c = file.get();
if (c=='\n')num++;
}
                
    file.close();
     cout << "-----------------------------------------------\n\n" << endl;
cout<<"Number of lines in file is: "<<  num <<endl;
  


 }
};
int main()
{
    file read;
    read.read_file();
    read.count_Size();
    read.count_Lines();
getch();
return 0;
}