How to get Present Logical Drives (the bitwise way)
Forget all that "C" old bit operator, you are "C++", use the modern STL way ;) #include #include void PrintLogicalDrives(){ using namespace std; bitset lt ld = (int)GetLogicalDrives(); for( char i = 'A'; i <= 'Z'; i++ ) { ...
Forget all that "C" old bit operator, you are "C++", use the modern STL way ;)
#include <bitset> #include <iostream> void PrintLogicalDrives() { using namespace std; bitset lt< 'Z' - 'A' + 1 > ld = (int)GetLogicalDrives(); for( char i = 'A'; i <= 'Z'; i++ ) { if( ld[ i - 'A' ] ) cout << i << ":" << endl; } }