All pastes #804079 Raw Edit

Miscellany

public text v1 · immutable
·published 2007-12-03 02:25 UTC
rendered paste body
void describeDisk(Disk *d) {
        cout << "Disk " << d->getDevPath() << ":\n";
        cout << "\tCylinders: " << d->getCylinders() << "\n";
        cout << "\tHeads: " << d->getHeads() << "\n";
        cout << "\tCylinder Size: " << d->getCylinderSize() << "(bytes)\n";
        cout << "\tSize: " << ((long long)(d->getCylinders() * d->getCylinderSize())) / (1024 * 1024) << "(MB)\n\n";
}


------------------OUTPUT----------------

Disk /dev/sda:
        Cylinders: 9729
        Heads: 255
        Cylinder Size: 8225280(bytes)
        Size: 2588(MB)