gpt4 book ai didi

c - 如何设置C盘

转载 作者:行者123 更新时间:2023-11-30 19:04:03 26 4
gpt4 key购买 nike

我想知道是否可以在 C 语言中切换驱动程序。

例如:

/*Example*/
#include <stdio.h>;

int main(){
SwitchDrive("C:\");
FILE *c=fopen("example.txt","w");
fprintf(c,"Example");
fclose(c);
SwitchDrive("D:\");
FILE *d=fopen("d_drive.txt","w");
fprintf(d,"Example");
fclose(d);
return 0;
}

最佳答案

您需要使用SetCurrentDirectory() .

关于c - 如何设置C盘,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53030367/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com