Sunday 7 July 2013

How to know current and maximum logical drives...??

#include<iostream.h>

#include<conio.h>

#include<dir.h>

void main()

{

  clrscr();

  int maxdrive;

  char disk;

  disk=getdisk()+'A';

  maxdrive=setdisk(2);

  cout<<"Current drive is : "<<disk;

  cout<<"\nMaximum logical drive is: "<<maxdrive;

  getch();

}

 

Here is the output: 

 

 

No comments:

Post a Comment