ok so what does this do..
1.) read the text file(most likely a c++ code in text form) line by line and display it line by line...
2.) (as the title says) check for syntax errors. ( only minor ones like missing ";" or a lack of closing braces)
soooo.....
#include <iostream>
#include <fstream>
#include <cstdlib>
using namespace std;
void main()
{
ifstream readFile("check.txt");
if(!readFile)
{
cout << "Please check the file's existance"<<endl;
exit(1);
}
char read[999];
while(readFile)
{
readFile.getline(read, 999);
if(readFile) cout << read << endl;
}
readFile.close();
}
sadly.. I don't know how to verify if the file read was a semi-colon or a curly brace
so I don't know how to start at the error detecting stuff...
can you please help me :( any attention would be greatly appreciated
thanks in advance :)