Hi... Do you remember me? Am the amateur programmer who disturbs you with my never ending doubts.. :D As you guys advised I have decided to start learning c++ from scratch..! ;)As far as am concerned Files in c++ is the most difficult part in c++ in my syllabus ..! yet it is the most satisfying and amusing part of it.. It feels great to create text files with out notepad..! I finds it the most satisfying face of c++ ! anyway I am still a beginner who is hungry for knowledge...Today I wrote a very simple c++ programme to show the contents of a text file which was create using notepad.. the program works correctly ,the desired output is obtained.. but the getch(); function seems to be dead.. The programming is not termination with a keystroke .. getch() has gone out of scope.. What is causing the error? Am I missing {} ?
here is the code... hoping that you would help this little bro..
#include<fstream.h>
#include<conio.h>
void main()
{
char a[20];
ifstream infile("venu.txt");
while(infile)
{
infile.getline(a,50);
cout<<a;
}
getch();
}