Latest Activity In Study Groups

Join Your Study Groups

VU Past Papers, MCQs and More

start trying, and help me completing this code. we still have time till tomorrow midnight.

#include <iostream>
#include <fstream>
#include <string>
/*open file with ifstream
use getline(infile, string); in while loop to read file line by line
save data in string and string to :istringstream iss (string)
tokenized data with delimiter " = ? \n" ignore space, =, ? and blank lines
use LL(1) parsing table with stack or just use stack
compare condition
output the data with your own userdefine function void ()
*/

using namespace std;

int main()
{
ifstream inFile("abc.txt");

if (inFile.fail()) {
cerr "Unable to open file for reading." endl;
exit(1);
}

string nextToken;
while (inFile >> nextToken) {
cout "Token: " nextToken endl;
}

inFile.close();

return 0;
}

Views: 1124

Replies to This Discussion

last date??

RSS

© 2021   Created by + M.Tariq Malik.   Powered by

Promote Us  |  Report an Issue  |  Privacy Policy  |  Terms of Service