Hi all. I want to learn how to manipulate .txt files through C++ program. I want to be able to search trough chars in .txt file,sort them etc. I think the best way for this,should be,loading .txt file in char array and then manipulating the elements. but I don't know how..
#include <iostream.h>
#include <fstream.h>
#include <string.h>
int main()
{
char array[100000];
fstream ru ("c:\\ruru.txt",ios::out);
for (int i=0;i<10000;i++)
{ ru << "rordo"; } // write to file
array[ ] =ru //obviously this doesn't work
return 0;
}