BlueGrey
calm
Elegant
Català-Valencià – Catalan
中文 – Chinese (Simplified)
中文 – Chinese (Traditional)
Česky – Czech
Dansk – Danish
Nederlands – Dutch
English – English
Suomi – Finnish
Français – French
Deutsch – German
עברית – Hebrew
हिंदी – Hindi
Magyar – Hungarian
Bahasa Indonesia – Indonesian
Italiano – Italian
日本語 – Japanese
한국어 – Korean
Македонски – Macedonian
मराठी – Marathi
Norsk – Norwegian
Polski – Polish
Português – Portuguese
Português – Portuguese (Brazil)
Русский – Russian
Slovenčina – Slovak
Slovenščina – Slovenian
Español – Spanish
Svenska – Swedish
Türkçe – Turkish
Українська – Ukrainian
Oëzbekcha – Uzbek
Subversion Repositories
Kolibri OS
(root)
/
data
/
common
/
develop
/
tcc
/
samples
/
files.c
– Rev 7630
Rev
Go to most recent revision
|
Blame
|
Last modification
|
View Log
|
Download
|
RSS feed
#include <stdio.h>
#include <stdlib.h>
int
main
(
int
argc
,
char
**
argv
)
{
int
i
;
char
c
;
FILE
*
f
;
FILE
*
fin
;
FILE
*
fout
;
//write to file
f
=
fopen
(
"testfile.txt"
,
"w"
)
;
for
(
i
=
0
;
i
<
50
;
i
++
)
{
fputc
(
'1'
,
f
)
;
}
fclose
(
f
)
;
//append to file
f
=
fopen
(
"testfile.txt"
,
"a"
)
;
for
(
i
=
0
;
i
<
50
;
i
++
)
{
fputc
(
'2'
,
f
)
;
}
fclose
(
f
)
;
//copy from testfile.txt to copyfile.txt
fin
=
fopen
(
"testfile.txt"
,
"r"
)
;
fout
=
fopen
(
"copyfile.txt"
,
"w"
)
;
while
(
(
c
=
fgetc
(
fin
)
)
!=
EOF
)
{
fputc
(
c
,
fout
)
;
}
fclose
(
fin
)
;
fclose
(
fout
)
;
}