+ 2
Why is it not showing characters after space. Though I have used getline.
#include <iostream> #include<fstream> using namespace std; int main() { char array[50]; cout<<" my array "<<endl; cin.getline(array,50); cout<<"name "<<array<<endl; ofstream out; out.open("bank.text",ios::app); out<<" name "<<array<<endl; out.close(); char arr1[500]; ifstream readfile; readfile.open("bank.text",ios::app); readfile.getline(arr1,500); readfile.close(); return 0; }
2 odpowiedzi