How to set drive in C

Fitz

New Member
#1
I wonder if it is possible to switch drivers in C.

For example:
Mã:
/*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;
}
 

Từ khóa phổ biến

You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an alternative browser.

Chủ Đề Xem Nhiều

Top