From the monthly archives:

June 2008

Read From File In C++

by Shabbir on June 7, 2008

in C/C++

In the previous tutorial we explained how to do that in C#, now we will do that in C++.
So, create a Win32 C++ Console Application. This tutorial will be similar to the tutorial for writing to file in c++,
So, write this code
 
int main()
{
ifstream in;
in.open("text.txt");
 
char line[256];
 
while(in.getline(line, 256))
cout << line << endl;
 
in.close();
}
Here we read the file line [...]

{ Comments }

    About the Author

  • author photo

    My Name is Shabbir Bhimani and I am developer by profession in the field of applications, web and database. Currently doing full time online marketing and like to share my experiences on how you can make money online @ CodeItWell.com. Read more ...


    See how you can get in touch with me.