使用C打开其他文件 [英] opening other files using C
问题描述
是否可以在main()执行期间打开C中的其他文件。
例如,我想打开一个生成声音的wave文件
main ()函数被调用。
Is it possible to open other files in C during main() execution.
Example, i want to open a wave file that generates a sound when ever
main() function is called.
推荐答案
mo ********* @ gmail.com 写道:
mo*********@gmail.com wrote:
是否有可能在C期间打开其他文件main()执行。
Is it possible to open other files in C during main() execution.
是的。
你的C书肯定会提到这个吗?
- -
Terse Hedgehog
花了很长时间,比最慷慨的估计要长得多。
- James White, / Sector General /
Yes.
Your C book surely mentions this?
--
Terse Hedgehog
"It took a very long time, much longer than the most generous estimates."
- James White, /Sector General/
mo *** ******@gmail.com 说:
是否可以在main()执行期间打开C中的其他文件。
Is it possible to open other files in C during main() execution.
是的。查看fopen,fclose,fread,fwrite,fseek,ftell,fgetpos,
fsetpos,fputc,fgetc,getc,putc,fgets,fputs,fscanf,fprintf,feof,
ferror,毫无疑问,我已经忘记了一些。
Yes. Look up fopen, fclose, fread, fwrite, fseek, ftell, fgetpos,
fsetpos, fputc, fgetc, getc, putc, fgets, fputs, fscanf, fprintf, feof,
ferror, and no doubt a few I''ve forgotten.
例如,我想打开一个生成声音的wave文件
调用
main()函数。
Example, i want to open a wave file that generates a sound when ever
main() function is called.
打开文件很简单。播放声音更难,C没有生成声音的标准方式(除非你算上写''\ a''到
标准输出,这不是'''在这种情况下适用)。你需要在专门用于实施的新闻组中询问如何做这个
。
-
理查德Heathfield
Usenet是一个奇怪的地方 - dmr 29/7/1999
http://www.cpax.org.uk
电子邮件:rjh在上述域名中, - www。
Opening the file is easy. Playing the sound is harder, and C has no
standard way to generate sounds (unless you count writing ''\a'' to
stdout, which doesn''t apply in this case). You''ll need to ask how to do
this in a newsgroup dedicated to your implementation.
--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at the above domain, - www.
< mo ********* @gmail.comwrote:
<mo*********@gmail.comwrote:
在main()执行期间是否可以在C中打开其他文件。
例如,我想打开在调用
main()函数时生成声音的wave文件。
Is it possible to open other files in C during main() execution.
Example, i want to open a wave file that generates a sound when ever
main() function is called.
你可能使用了错误的魔术词(打开)查询系统()在
< stdlib.h> ,它可能是你想要的......
It''s possible you used the wrong magic words (open) Look up system() in
<stdlib.h>, it may be what you want..
这篇关于使用C打开其他文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!