Code:#include <fstream> #include <iostream> #include <string> using namespace std; int main() { char str[100]; ofstream a_file ( "example.txt" ); a_file<<"This text will now be inside of example.txt"; a_file.close(); ifstream b_file ( "example.txt" ); b_file>> str; cout<< str <<"\n"; cin.get(); }
why is just prints "this", it supposed to print "This text will now be inside of example.txt".
is there any solution for this?