日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

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

發布時間:2023/12/1 编程问答 48 豆豆
生活随笔 收集整理的這篇文章主要介紹了 c语言 函数的参数传递示例_C语言中带有示例的remove()函数 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

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 fileif((f=fopen("includehelp.txt","r"))==NULL){ printf("File does not exist...\n"); }else{printf("File is exist.\n"); }fclose(f);//remove fileif(remove("includehelp.txt"))printf("Remove error.....\n");elseprintf("File is removed\n");//Check the existence of that fileif((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()函数的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。