i am having trouble compiling this program getting a the error is "Declaration Syntax error" using borland c++ bulider v.6 if any one can help thanks
Expand|Select|Wrap|Line Numbers
- void __fastcall TFrame2::FrameClick(TObject *Sender)
- {
- int main()
- { //it is showing the error right here
- ifstream myfile("c:\fileopen.txt");
- if(myfile.is_open())
- {
- while(!myfile.eof())
- {
- getline(myfile, line);
- cout<<line<<endl;
- }
- myfile.close();
- }
- else cout<<"Unable to open file"<<endl;
- }
- return 0;
- }