Pages

Sunday, September 4, 2011

Finding Maximum Logical Drives with C and C++

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();
}

Output

17 comments:

shahanara said...

a good helpful program. thanks....

Laxmikant Bhumkar said...

Dear you have very nice blog..

Anonymous said...

Very nice post. I am a programmer of Python, C, AS2, ASP and also html. Have a nice day. Will follow your blog.

Malok Mading said...

Great learning this cool information. Thanks for sharing this tips.

Janmejai said...

OOH Programming I Love C Language But the truth is that i have never done any programming after my classes.

Tanmay Roy said...

Nice
Great Work Keep it up.......

myreviewsforall said...

i will try

New Inspiron Netbook said...

I'll also try it.. Thanks :-)

World Famous said...

C language, It's an interesting language. I do this sometimes and today I'll try these codes.
Thanks for sharing Test Paper

Jhon said...

interesting language thanks for sharing I'll try these codes.

TestKing said...

Thank you for sharing such relevant topic with us. I really love all the great stuff you provide. Thanks again and keep it coming.

mehran said...

nice and beautiful information plz keep it up sharing

Unknown said...
This comment has been removed by the author.
Unknown said...
This comment has been removed by the author.
Unknown said...

great and free information for new one

Anonymous said...

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

CPP Tutorials said...

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