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;
}
 
Top