This article will show how to know the current drive’s name and the maximum logical drives that
your system supports with C and C++. The getdisk () function
is used to show the current drive name and the setdisk () function
is used to know the maximum logical drives of any system. The programming code to find Maximum Logical Drives with
C and C++ is given below.
#include<stdio.h>
#include<conio.h>
#include<dir.h>
void main()
{
clrscr();
int disk, maxdrive;
disk=getdisk()+'A';
maxdrive=setdisk(2);
printf("Current drive is : %c\n",disk);
printf("Maximum logical drive is:%d\n",maxdrive);
getch();
}
#include<stdio.h>
#include<conio.h>
#include<dir.h>
void main()
{
clrscr();
int disk, maxdrive;
disk=getdisk()+'A';
maxdrive=setdisk(2);
printf("Current drive is : %c\n",disk);
printf("Maximum logical drive is:%d\n",maxdrive);
getch();
}
Output
17 comments:
a good helpful program. thanks....
Dear you have very nice blog..
Very nice post. I am a programmer of Python, C, AS2, ASP and also html. Have a nice day. Will follow your blog.
Great learning this cool information. Thanks for sharing this tips.
OOH Programming I Love C Language But the truth is that i have never done any programming after my classes.
Nice
Great Work Keep it up.......
i will try
I'll also try it.. Thanks :-)
C language, It's an interesting language. I do this sometimes and today I'll try these codes.
Thanks for sharing Test Paper
interesting language thanks for sharing I'll try these codes.
Thank you for sharing such relevant topic with us. I really love all the great stuff you provide. Thanks again and keep it coming.
nice and beautiful information plz keep it up sharing
great and free information for new one
Evеry weekеnd і useԁ to gο to sее this web ѕіtе, foг thе reаson that і ωіsh foг enjoyment, foг the reasοn thаt
this this sіte conationѕ really good funnу materіal tοo.
Lοoκ at my web рage deep fat frier
Nice information and thanks for posting this here! Please keep sharing more information like this further in future. You can find more information on C++ Tutorials in the following link.
CPP Tutorials
Post a Comment