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

21 comments:

shahanara said...

a good helpful program. thanks....

Lucky said...

Dear you have very nice blog..

Sarang Mangi (SindhiTech) 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.

Cheap Flights said...

There are many places worth seeing in the city of Seattle. The galleries and museums present here are truly inspiring. The museums display art works of many artists. The lake in the city is used for swimming and boating. Those who get Seattle flights surely visit these attractions and enjoy themselves.
Los Angeles Flights|Cheap Flights to Las Vegas|Cheap Flights Tickets.

Janmejai said...

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

Tonmoy 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

Arpanet.MS said...

yes thst is right and i glad to see this website thanks for sharing this knowledge
ArpanetSoft.Com - Website for Blog, Forum, Poll and Free Submit Url
http://www.arpanetsoft.com
Thanks,

Steve said...

nice blog checkout my latest blog at

http://www.togetherfornature.blogspot.com

feel free to leave a comment

asif sajjad said...
This comment has been removed by the author.
asif sajjad said...
This comment has been removed by the author.
asif sajjad said...

great and free information for new one

Anonymous said...

Easybinarycash.com - Learn how to turn $500 into $5,000 in a month!

[url=http://www.easybinarycash.com/]Make Money Online[/url] - The Secret Reveled with Binary Option

Binary Options is the way to [url=http://www.easybinarycash.com/]make money[/url] securely online

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