User Tools

Site Tools


c_-_c_files:file_copy

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
c_-_c_files:file_copy [2017/10/12 15:10] peterc_-_c_files:file_copy [2020/07/15 09:30] (current) – external edit 127.0.0.1
Line 40: Line 40:
 } }
 </code> </code>
 +
 +and
 +
 +<code c>
 +#include<iostream.h>
 +#include<conio.h>
 +#include<fstream.h>
 +#include<stdio.h>
 +
 +void main()
 +{
 +  clrscr();
 +  char ch,st[100];
 +  ofstream o("r.txt");
 +
 +  do 
 +  {
 +    ch=cin.get();
 +    fflush(stdin);
 +    o.put(ch);
 +  } while(ch!='.');
 + 
 +  o.close();
 +  ifstream i;
 +  i.open("r.txt");
 +  ofstream k;
 +  k.open("m.txt");
 + 
 +  while(!i.eof()) 
 +  {
 +    i.read((char*)&st,sizeof(st));
 +    k.write((char*)&st,sizeof(st));
 +    cout<<"\n After copying of the file:";
 +    cout<<st; 
 +  }
 + 
 +  getch(); 
 +}
 +</code>
 +
 +
  
c_-_c_files/file_copy.1507821013.txt.gz · Last modified: 2020/07/15 09:30 (external edit)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki