Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Program which initializes a string variable and outputs the string to the disk file.
- #include<iostream.h>
- #include<conio.h>
- #include<fstream.h>
- void main()
- {
- clrscr();
- char a[]="Program which initializes a string variable and outputs the string to the disk file.";
- ofstream ofile("disk.txt");
- ofile<<a;
- ofile.close();
- char b;
- ifstream ifile("disk.txt");
- while(!ifile.eof())
- {
- ifile.get(b);
- cout<<b;
- }
- getch();
- }
Advertisement
Add Comment
Please, Sign In to add comment