123
char text[500000] = "."; fread(text, sizeof(char)||sizeof(int), 500000-1, filepad); textLength = strlen(text);
12345678910111213141516
#include <string> #include <fstream> #include <iterator> std::string read_text( const char* path2file ) { std::ifstream file( path2file ) ; return std::string( std::istreambuf_iterator<char>(file), std::istreambuf_iterator<char>() ) ; } int main() { std::string text = read_text( "myfile.txt" ) ; auto text_length = text.size() ; }