Skip to content

Instantly share code, notes, and snippets.

@hash3liZer
Created January 31, 2020 12:20
Show Gist options
  • Save hash3liZer/c6bdeac965aebf4f820f20e52977676a to your computer and use it in GitHub Desktop.
Save hash3liZer/c6bdeac965aebf4f820f20e52977676a to your computer and use it in GitHub Desktop.
Printing Connected Removable Media Drives on the Computer in C++
#include <iostream>
#include <string>
#include <Windows.h>
void remMediaDrives(){
string value = "";
for(char i=65; i<=90; i++){
value = i;
value += ':';
if(GetDriveType( value.c_str() ) == DRIVE_REMOVABLE){
cout << value << endl;
}
}
}
int main(){
remMediaDrives();
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment