int main()
{
char ch;
char text[500];
char s[500];
ifstream fin("bitch.txt",ios::in);
while(!fin.eof())
{
fin.getline(s,500);
}
fin.close();
for (int i=0; i<500; i++)
{
cout << s[i];
}
return 0;
}
How to copy a whole text file contents into a char array in c++ considering the text file contains a 100 characters long paragraph I need to read the spaces too .