Connecting Tech Pros Worldwide Help | Site Map

can c++ deal with hardware???

mohamed azaz
Guest
 
Posts: n/a
#1: Sep 24 '07
hi

I want to know

can c++ deal with hardware??

like fax modem or Lan or Audio device

Phlip
Guest
 
Posts: n/a
#2: Sep 24 '07

re: can c++ deal with hardware???


mohamed azaz wrote:
Quote:
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.

--
Phlip


Victor Bazarov
Guest
 
Posts: n/a
#3: Sep 24 '07

re: can c++ deal with hardware???


mohamed azaz wrote:
Quote:
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
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask


mohamed azaz
Guest
 
Posts: n/a
#4: Sep 24 '07

re: can c++ deal with hardware???





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













On Sep 24, 5:04 pm, "Victor Bazarov" <v.Abaza...@comAcast.netwrote:
Quote:
mohamed azaz wrote:
Quote:
I want to know
>
Quote:
can c++ deal with hardware??
>
Quote:
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
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask

=?UTF-8?B?RXJpayBXaWtzdHLDtm0=?=
Guest
 
Posts: n/a
#5: Sep 24 '07

re: can c++ deal with hardware???


On 2007-09-24 20:28, mohamed azaz wrote:
Quote:
On Sep 24, 5:04 pm, "Victor Bazarov" <v.Abaza...@comAcast.netwrote:
Quote:
>mohamed azaz wrote:
Quote:
I want to know
>>
Quote:
can c++ deal with hardware??
>>
Quote:
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'.
>
>
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-lit...t.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.

--
Erik Wikström
Default User
Guest
 
Posts: n/a
#6: Sep 24 '07

re: can c++ deal with hardware???


mohamed azaz wrote:
Quote:
>
>
>
thank you very much
Please don't top-post. Your replies belong following or interspersed
with properly trimmed quotes. See the majority of other posts in the
newsgroup, or the group FAQ list:
<http://www.parashift.com/c++-faq-lite/how-to-post.html>
Closed Thread