Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > can c++ deal with hardware???

Reply
Thread Tools

can c++ deal with hardware???

 
 
mohamed azaz
Guest
Posts: n/a
 
      09-24-2007
hi

I want to know

can c++ deal with hardware??

like fax modem or Lan or Audio device

 
Reply With Quote
 
 
 
 
Phlip
Guest
Posts: n/a
 
      09-24-2007
mohamed azaz wrote:

> 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


 
Reply With Quote
 
 
 
 
Victor Bazarov
Guest
Posts: n/a
 
      09-24-2007
mohamed azaz wrote:
> 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


 
Reply With Quote
 
mohamed azaz
Guest
Posts: n/a
 
      09-24-2007



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



 
Reply With Quote
 
=?UTF-8?B?RXJpayBXaWtzdHLDtm0=?=
Guest
Posts: n/a
 
      09-24-2007
On 2007-09-24 20:28, mohamed azaz wrote:

> On Sep 24, 5:04 pm, "Victor Bazarov" <v.Abaza...@comAcast.net> wrote:
>> mohamed azaz wrote:
>> > 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'.

>
>
> 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
 
Reply With Quote
 
Default User
Guest
Posts: n/a
 
      09-24-2007
mohamed azaz wrote:

>
>
>
> 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>
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
AMD64 or Semperon, deal or no deal? Tad Confused Computer Information 7 04-13-2006 05:43 PM
deal or no deal rbt Python 7 12-28-2005 08:57 PM
Can libxslt deal with XSLT 2.0? Dr. Roger Wießner XML 2 03-17-2005 03:13 PM
How to deal with integer that can be null in sql server? TomislaW ASP .Net 5 11-22-2004 03:27 PM
CAN'T DEAL WITH PEOPLE Shy Shawn MCSE 26 10-05-2004 12:22 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57