全文预览

unixc函数大全

上传者:学习一点 |  格式:pdf  |  页数:61 |  大小:4501KB

文档介绍
void)\r{\rchar oldname[80], newname[80];\r/* prompt for file to rename and new name */\rprintf("File to rename: “)(\rgets(oldname);\rprintf("New name: “)(\rgets(newname);\r/* Rename the file */\rif (rename(oldname, newname) == 0)\rprintf("Renamed %s to %s.n", oldname, newname);\relse\rperror(Mrename");\rreturn 0;\r).\r 0`rewind\r??;ƒ!"”¸{y”^?—¦÷\r int rewind(FILE * stream);\r\r#include <stdio.h>\r#include <dir.h>\rint main(void)\r(\rFILE *fp;\rchar *fname = "TXXXXXX*', *newname, first;\rnewname = mktemp(fname);\rfp = fopen(newname,"w+“)(\rfprintfCfp/^bcdefghijklmnopqrstuvwxyz*');\rrewind(fp);\rf scant (fp, "%c", &f i rst);\rprintf("The first character is: %cnM,first);\rfclose(fp);\rremove(newname);\rreturn 0;\r)

收藏

分享

举报
下载此文档