I want to make a program which ask the user to enter double values and stores it in a file. The inputs process ends when the user enters cntr+d. Can someone suggest how to do it ? i wrote the following code but it doesn't work !
ofstream file("test.txt");
double num;
char ch;
while ( int(ch) != 4 )
{
cout << " Enter Value: ";
cin >> num >> ch;
file << num;
}
Waiting for your help ! :-)