I want to read only the characters from the first line of a file and then stop. The following code is not working in Codeblocks because the output file is empty. What did I do wrong?
#include <fstream>
using namespace std;
ifstream cin ("test.in");
ofstream cout ("test.out");
char s;
int main()
{
while (cin>>s)
if (s=='\n')
{
cout<<"end of line"; return 0;
}
return 0;
}