how to access cd drive using c programming language

Recommended Answers

All 5 Replies

C doesn't know anything about a CD drive. Your computer knows about the CD drive, because it has a driver that handles it. C just passes the request along to the operating system, and the operating system passes it along to the driver.

That's why you can't use a device, until you have a driver for it.

But i hav a coding which accesses floppy

You should be able to access any drive - hard drive, floppy drive, or cd drive - just by changing the letter of the drive, in your program.

You want to *definitely* use high level stream file functions, not low level non-stream, functions.

Remember that a floppy or CD drive, will have much slower access times, compared to a HD, so you may need to introduce a delay() or a very short sleep(). Just a second or two, should be enough, if it's needed at all.

Lemme guess.

You've found an example for your fossil C compiler (TurboC) that accesses the floppy disk (but it knows nothing about CDs, since it pre-dates them by a few 1000 years).

On the other hand, your brand new machine is so new that floppies are ancient technology (last used by druids), and it only has a CD.

Can you explain the context of the problem ?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.