Hi, Friends
When I am trying to make a file which of .txt type. it is not generating it perfactly.
this is my program.. The thing is it is creating a .txt file but copy only first two letters. Why?
and how can can I make it perfact?
When I am trying to make a file which of .txt type. it is not generating it perfactly.
Code:
#include<iostream.h> #include<fstream.h> #include<conio.h> void main() { clrscr(); char *name; fstream test; test.open("try.txt",ios::binary|ios::out); cout<<"Enter Name"; cin>>name; cout<<endl<<name; test.write((char*)name,sizeof(name)); test.close(); getch(); }
and how can can I make it perfact?
Comment