c语言 函数的参数传递示例

C语言中的remove()函数 (remove() function in C)

The remove() function is defined in the <stdio.h> header file.

remove()函数在<stdio.h>头文件中定义。

Prototype:

原型:

    int remove(const char* filename);

Parameters: const char *filename

参数: const char *文件名

Return type: int

返回类型: int

Use of function:

使用功能:

When we are dealing with files then sometimes we need to erase or delete some files. In file handling, we use remove() function to erase the files. The prototype of the function remove() is int remove(const char* filename);

当我们处理文件时,有时我们需要擦除或删除一些文件。 在文件处理中,我们使用remove()函数擦除文件。 函数remove()原型是int remove(const char * filename);

Here, filename is the name of the file which has to be erased. It returns zero if the file is successfully deleted and non zero if an error occurred.

在这里, 文件名是必须删除的文件的名称。 如果成功删除了文件,则返回零;如果发生错误,则返回非零。

C语言中的remove()示例 (remove() example in C)

#include <stdio.h>
#include <stdlib.h>
int main(){FILE *f;
//Check the existence of that file
if((f=fopen("includehelp.txt","r"))==NULL){
printf("File does not exist...\n");
}
else{printf("File is exist.\n");
}
fclose(f);
//remove file
if(remove("includehelp.txt"))
printf("Remove error.....\n");
else
printf("File is removed\n");
//Check the existence of that file
if((f=fopen("includehelp.txt","r"))==NULL){printf("File does not exist...\n");
}
else{printf("File is exist.\n");
}
fclose(f);
return 0;
}

Output

输出量

翻译自: https://www.includehelp.com/c-programs/remove-function-in-c-language-with-example.aspx

c语言 函数的参数传递示例

c语言 函数的参数传递示例_C语言中带有示例的remove()函数相关推荐

  1. c#中的long类型示例_C#中带示例的带符号字节数组

    c#中的long类型示例 C#中的有符号字节数组 (Signed Byte Array in C#) In C#.Net, we can create a signed byte array by u ...

  2. c#中的long类型示例_C#中带示例的无符号字节数组

    c#中的long类型示例 C#中的无符号字节数组 (Unsigned Byte Array in C#) In C#.Net, we can create an unsigned byte array ...

  3. stl max函数_C ++ STL中带有示例的array :: max_size()函数

    stl max函数 C ++ STL array :: max_size()函数 (C++ STL array::max_size() function) max_size() function is ...

  4. 为什么构造函数不能声明为虚函数,析构函数可以,构造函数中为什么不能调用虚函数?

    为什么构造函数不能声明为虚函数,析构函数可以,构造函数中为什么不能调用虚函数 构造函数中为什么不能调用虚函数? 第一个理由是概念上的 第二个理由是机械上的. 构造函数不能声明为虚函数的原因是 1 构造 ...

  5. c语言 函数的参数传递示例_C ++中带有示例的nearint()函数

    c语言 函数的参数传递示例 C ++附近的int()函数 (C++ nearbyint() function) nearbyint() function is a library function o ...

  6. c语言getchar函数_C语言中带有示例的getchar()函数

    c语言getchar函数 C语言中的getchar()函数 (getchar() function in C) The getchar() function is defined in the < ...

  7. c语言gets,getc,C++_C语言的getc()函数和gets()函数的使用对比,C语言getc()函数:从流中读取字 - phpStudy...

    C语言的getc()函数和gets()函数的使用对比 C语言getc()函数:从流中读取字符头文件: #include 函数getc()用于从流中取字符,其原型如下: int getc(FILE *s ...

  8. 单片机sleep函数的头文件_c语言的 sleep函数到底在哪个头文件里啊

    展开全部 在里面. 在VC中使用时,sleep函数的头文件为windows.h,在Linux下,gcc编译器中,使用的头文件因gcc版本62616964757a686964616fe59b9ee7ad ...

  9. 单片机sleep函数的头文件_C语言之Sleep函数

    Sleep函数: 功 能: 执行挂起一段时间 用 法: unsigned sleep(unsigned seconds); 注意: 在VC中使用带上头文件#include ,在Linux下,gcc编译 ...

最新文章

  1. Java反射 - 动态类加载和重载
  2. 互联网公司「敏捷开发」,打造高效执行能力
  3. 清华旷视:RepVGG,更佳的速度-精度trade-off!
  4. 零基础入门学习Python(5)Python的数据类型
  5. ExtJS之对话框及窗口篇
  6. OSChina 周三乱弹 —— 孤独到都和病毒发生了感情了
  7. python3练习题:并发编程(21-25)
  8. 贝叶斯分类器(Normal Bayes 分类器)
  9. java 静态对象赋值_基于Java class对象说明、Java 静态变量声明和赋值说明(详解)...
  10. html5中preclass,为什么HTML5建议把代码元素放在pre?
  11. mongodb添加创建修改时间_MongoDB数据库插入、更新和删除操作详解
  12. vs2008 及.netframework3.5 安装问题
  13. 手机里tencent文件夹能删吗_手机内存卡里的tencent这个文件夹可以删吗?
  14. Android上按钮解决快速点击问题
  15. [Markdown] Markdown使用 - 持续更新
  16. FCM-模糊C均值聚类算法简介及C++实现代码
  17. matlab不显示x,y,z轴
  18. 淘淘商城第77讲——实现商品详情页面展示
  19. Java pcm文件与wav文件互转
  20. 5个超经典实验,老杨带你高效进阶OSPF

热门文章

  1. 将 改为c语言表达式,基于c语言表达式求解课程设计修改.doc
  2. JSP 插入到数据库的数据出现 “SQLServerException: 将截断字符串或二进制数据” 错误解决方案
  3. 原生js实现简单JSONP
  4. 微信内置浏览器点击“返回”关闭窗口
  5. vue-cli打包之后的项目在nginx的部署
  6. CSS 小结笔记之em
  7. ScanTailor-ScanTailor 强大的多方位的满足处理扫描图片的需求
  8. 排序算法之(7)——堆排序
  9. 示例 Demo 工程和 API 参考链接
  10. [windows phone 7 ]查看已安装程序GUID