[C/C++] Informacje o partycjach

0

Cześć @LL

Poniżej zamieszczam kod w Pascalu --> please --> czy mógłby ktoś przekonwertować mi go C? :-)

uses crt,dos;
var
i:byte;

begin
writeln('Detecting partitions ...');
writeln(' PART SIZE USED FREE');
for i:=3 to 26 do
if disksize(i)-1 then
writeln(' ',chr(i+64),': ',(disksize(i)/1024)0,' ',
((disksize(i)-diskfree(i))/1024)0,' ',
(diskfree(i)/1024)0);
halt(0);
end.

Bardzo proszę i z góry dziękuję :-)

0

Czesc
Moze Ci to cos wyjasni wyciagnełem z helpa bcb :

Returns the size, in bytes, of a specified drive :
DiskSize returns the size in bytes of the specified drive, where 0 = Current, 1 = A, 2 = B, etc. DiskSize returns -1 if the drive number is invalid.

Returns the number of free bytes on a specified drive.
DiskFree returns the number of free bytes on the specified drive, where 0 = Current, 1 = A, 2 = B, and so on.

i przykłady :
The following example displays in a dialog the disk free space of the current drive with commas as thousand separators.

ShowMessage(FormatFloat("#,##0 bytes", DiskFree(0)));

This example uses a form with a label on it. When the following code executes, it displays a message in the label indicating the number of KB free, and what percentage of the entire disk space that represents.

__int64 AmtFree = DiskFree(0);
__int64 Total = DiskSize(0);
AnsiString S;
S.sprintf("%I64d percent of the space on drive 0 is free: %I64d KB", AmtFree*100/Total, AmtFree/1024 );
Label1->Caption = S;
Powodzenia [cya]

1 użytkowników online, w tym zalogowanych: 0, gości: 1