c_-_c_files:file_copy
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
c_-_c_files:file_copy [2017/10/12 15:11] – peter | c_-_c_files:file_copy [2020/07/15 09:30] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== C - C++ Files - File copy ====== | ====== C - C++ Files - File copy ====== | ||
- | |||
- | <code c> | ||
- | # | ||
- | # | ||
- | # | ||
- | # | ||
- | |||
- | void main() | ||
- | { | ||
- | clrscr(); | ||
- | char ch,st[100]; | ||
- | ofstream o(" | ||
- | |||
- | do | ||
- | { | ||
- | ch=cin.get(); | ||
- | fflush(stdin); | ||
- | o.put(ch); | ||
- | } while(ch!=' | ||
- | |||
- | o.close(); | ||
- | ifstream i; | ||
- | i.open(" | ||
- | ofstream k; | ||
- | k.open(" | ||
- | |||
- | while(!i.eof()) | ||
- | { | ||
- | i.read((char*)& | ||
- | k.write((char*)& | ||
- | cout<<" | ||
- | cout<< | ||
- | } | ||
- | |||
- | getch(); | ||
- | } | ||
- | </ | ||
- | |||
- | and | ||
<code cpp> | <code cpp> | ||
Line 79: | Line 40: | ||
} | } | ||
</ | </ | ||
+ | |||
+ | and | ||
+ | |||
+ | <code c> | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | |||
+ | void main() | ||
+ | { | ||
+ | clrscr(); | ||
+ | char ch,st[100]; | ||
+ | ofstream o(" | ||
+ | |||
+ | do | ||
+ | { | ||
+ | ch=cin.get(); | ||
+ | fflush(stdin); | ||
+ | o.put(ch); | ||
+ | } while(ch!=' | ||
+ | |||
+ | o.close(); | ||
+ | ifstream i; | ||
+ | i.open(" | ||
+ | ofstream k; | ||
+ | k.open(" | ||
+ | |||
+ | while(!i.eof()) | ||
+ | { | ||
+ | i.read((char*)& | ||
+ | k.write((char*)& | ||
+ | cout<<" | ||
+ | cout<< | ||
+ | } | ||
+ | |||
+ | getch(); | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | |||
c_-_c_files/file_copy.1507821065.txt.gz · Last modified: 2020/07/15 09:30 (external edit)