here is the code i wrote i am not sure whats wrong but the contxs.txt file its not opening. The code the just skips to end from the part where i am trying to read anything from context file.
if (datafile.is_open())
{
==>> while (contextfile.is_open()) <<==
{
getline(contextfile, con);
{
for (i = 1; i <= 6; i++)
{
cout << "enter the Noun:";
cin.getline(n1, sizeof(n1));
string n1_1(n1);
Some quick things, I you allow me.
The first "if" has no sense, since the "while" asks the same question.
If contextfile says that is open ... then is open. Another thing is what does getline do. What are the contents of the file? Text? Then why to use ifstream? Why don't you use istringstream instead?