can c++ deal with hardware???

M

mohamed azaz

hi

I want to know

can c++ deal with hardware??

like fax modem or Lan or Audio device
 
P

Phlip

mohamed said:
I want to know

can c++ deal with hardware??

like fax modem or Lan or Audio device

Google "device driver". C++ can access them, and I suspect can write them.
But modern OSs always use a driver architecture.

On a very small platform, such as a cell phone, C++ might _be_ the device
driver. In that case, it typically access hardware using platform-specific
keywords that activate specific CPU instructions. And some hardwares map
hardware instructions onto specific memory locations, and C++ can declare a
pointer to these.
 
V

Victor Bazarov

mohamed said:
I want to know

can c++ deal with hardware??

like fax modem or Lan or Audio device

What do you mean by "can"? Can one write a program in C++ that
would control hardware? Sure. AFAIK people do it all the time.
Can one write such a program only using *standard C++ means*?
Most likely, no. Unless your device control is provided by the
OS through a named file, and all hardware intercation can be
accomplished by reading from, and writing into, that file, you
will have to resort to some special ways to interact with the
hardware in question, like 'outp' or 'inp' or 'ioctl'.

V
 
M

mohamed azaz

thank you very much
but I want to write aprogramm by c++ chek if there is dial tone or
not??
how can I make this by c++?

thank you again
 
G

Guest

thank you very much
but I want to write aprogramm by c++ chek if there is dial tone or
not??
how can I make this by c++?


Please do not top post, and do not quote signatures.

To check if there is a dial tone you would probably not have to interact
with the modem directly, you would probably use some kind of Windows API
(I assume that is your platform), for more information you should ask in
a group discussing programming on your platform, the FAQ lists a few:
http://www.parashift.com/c++-faq-lite/how-to-post.html#faq-5.9

For the future, please not that questions for which the answer is
dependent on your platform are off topic in here.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top