VS 2019 пишет, что отсутствуют экземпляры перегруженной функции. Getline подчёркнут красным
#include<fstream>
#include <iostream>
#include <cstring>
#include <string>
using namespace std;
int main()
{
setlocale(LC_ALL, "ru");
int kol=0;
ofstream fout;
ifstream read;
string file="file.txt";
read.open(file);
if (!read.is_open())
{
cout << "Файл не открылся!\n";
}
else
{
char a;
cout << "Файл открыт!\n";
while (read.get(a))
{
kol++;
}
char* A = new char[kol];
char p;
int* B = new int[kol-1];
char b;
int po = 0;
while (!read.eof())
{
getline(read, b);
po++;
}
for (int j = 0;j < kol;j++)
{
cout << A[j];
}
}
read.close();
system("pause");
}
while (!read.eof())?... Потом у вас и этот вопрос встанет... Превентивно - читайте https://ru.stackoverflow.com/q/833980/195342 – Harry Apr 10 '20 at 03:43