C/C++检测可移动磁盘的盘符源代码

#include <stdio.h>
#include <windows.h>
int main()
{
long i,j;
TCHAR buf[200];
TCHAR *cdbuf;
j=GetLogicalDriveStrings(sizeof(buf),buf);
for(i=0;i<j;i+=4)
{
cdbuf=&buf[i];
if(GetDriveType(cdbuf)==DRIVE_REMOVABLE)
printf("%sn",cdbuf);
}
return 0;
}

0 条评论

What is 4 + 4 ?
Please leave these two fields as-is:
不答对这道小题,是不给通过的哦

昵称

This site uses Akismet to reduce spam. Learn how your comment data is processed.

沙发空缺中,还不快抢~