您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

使用C/C++程序创建目录或文件夹

2025/4/20 17:17:14发布28次查看
在本教程中,我们将讨论使用 c/c++ 程序创建目录或文件夹的程序。
要创建新目录,我们将使用 mkdir() 命令。请注意,给定的代码仅适用于 windows 编译器。
示例#include <conio.h>#include <dir.h>#include <process.h>#include <stdio.h>void main(){ int check; char* dirname = "tutorialspoint"; clrscr(); check = mkdir(dirname); //checking if directory is created if (!check) printf("directory created\n"); else { printf("unable to create directory\n"); exit(1); } getch(); system("dir/p"); getch();}
输出directory created
以上就是使用c/c++程序创建目录或文件夹的详细内容。
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product