Sunday, 20 August 2017

Program to create a File and write data in it .(FILE HANDLING)

#include<fstream.h>
#include<conio.h>
#include<stdio.h>
#include<stdlib.h>
void main()
{ clrscr();
  char word;
  ofstream obj;
  obj.open("tanuj.txt");  
  cout<<"Enter name \n";
  do
    { word=getche();
      obj<<word;
    } while(word!=';');
  cout<<"Thankyou for entering data ";
  obj.close();
  getch();
}

No comments:

Post a Comment

Basic Implementation of Array as a Pointer

#include<iostream.h> #include<conio.h> void main() { clrscr();   int arr[5];   cout<<"Enter 5 nos. ";   f...