C++ Programming Blog

 
 
 
# include <iostream.h>
# include <conio.h>
# include <fstream.h>

class machine
{
    char name[10];
    long int phone;
    public:
    void getdata()
    {
        cout<<\"ENTER THE NAME:->\";
        cin>>name;
        cout<<\"\\nENTER THE PHONE NUMBER:->\";
        cin>>phone;
    }
    void show()
    {
        cout<<\"\\nTHE NAME IS:->\"<<name;
        cout<<\"\\nTHE PHONE NUMBER is:->\"<<phone;
    }
};

main()
{
machine m;
fstream file;
file.open(\"data\",ios::ate|ios::in|ios::out|ios::binary);
file.seekg(0,ios::beg);

cout<<\"\\nTHE CONTENTS OF FILE ARE.\\n\";
while(file.read(char *)&m,sizeof(m))

    Related Post:
  1. Program to estimate the value of Fourth Derivative of the function at the given points from the given data using Central Difference Formula of order 2

  2. PROGRAM FOR PASS-I & PASS-II

  3. Program to generate a triangular wave form according to a specified pair of Amplitude and Frequency

  4. Program of inline function

  5. Program to illustrate the binary operator(-) overloading by creating an object of that class

  6. Program to illustrate the declaration , initialization and printing a constant variable

  7. Program to estimate the Differential value of a given function using Trapezoidal Rule [Predictor-Corrector Scheme (PC2)]

  8. Program that takes input of counter and displays output of incremented counter using overloading operator++

  9. Program to interchange the values of two int , float and char using function templates

  10. Program of circular doubly link list with insert, append, delete, copy, reverse and display operations

  11. Program to illustrate the binary operator(-) overloading without creating an object of that class

  12. Program that prints all the even numbers b/w 0 to 50 ( using while, do-while and for loop )

  13. Program of scanfill algorithm

  14. Program to estimate the Differential value of the function at the given point from the given data using Mid-Point Method

  15. Program to illustrate the passing of values to constructor in classes

  16. Program to illustrate the implementation of Double Ended linked list as a Queue

  17. Program to illustrate the implementation of Reflection Transformation about x-axix, y-axis and w.r.t origin

  18. FUNCTION WITH ALIAS NAME OR REFERENCE VARIABLE IN C++

  19. Program that performs selection search

  20. Program to perform selection sort

 
 
Didn't find what you were looking for? Find more on Program that provides an example of binary files