can c++ deal with hardware???

Discussion in 'C++' started by mohamed azaz, Sep 24, 2007.

  1. mohamed azaz

    mohamed azaz Guest

    hi

    I want to know

    can c++ deal with hardware??

    like fax modem or Lan or Audio device
     
    mohamed azaz, Sep 24, 2007
    #1
    1. Advertising

  2. mohamed azaz

    Phlip Guest

    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
     
    Phlip, Sep 24, 2007
    #2
    1. Advertising

  3. 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
     
    Victor Bazarov, Sep 24, 2007
    #3
  4. mohamed azaz

    mohamed azaz 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++?

    thank you again













    On Sep 24, 5:04 pm, "Victor Bazarov" <> 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
     
    mohamed azaz, Sep 24, 2007
    #4
  5. On 2007-09-24 20:28, mohamed azaz wrote:

    > On Sep 24, 5:04 pm, "Victor Bazarov" <> 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-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.

    --
    Erik Wikström
     
    =?UTF-8?B?RXJpayBXaWtzdHLDtm0=?=, Sep 24, 2007
    #5
  6. mohamed azaz

    Default User Guest

    Re: can c++ deal with hardware??? - TPA

    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>
     
    Default User, Sep 24, 2007
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. TomislaW
    Replies:
    5
    Views:
    33,542
    Ignacio Machin \( .NET/ C# MVP \)
    Nov 22, 2004
  2. Dr. Roger Wießner

    Can libxslt deal with XSLT 2.0?

    Dr. Roger Wießner, Mar 17, 2005, in forum: XML
    Replies:
    2
    Views:
    4,909
    Martin Honnen
    Mar 17, 2005
  3. rbt

    deal or no deal

    rbt, Dec 22, 2005, in forum: Python
    Replies:
    7
    Views:
    600
    Duncan Smith
    Dec 28, 2005
  4. gorilorzhang
    Replies:
    1
    Views:
    1,774
    Alexey Smirnov
    Jun 4, 2007
  5. M.Liang Liu

    [Makefile]How can I deal with multi-dirs?

    M.Liang Liu, Apr 1, 2008, in forum: C Programming
    Replies:
    10
    Views:
    572
    CBFalconer
    Apr 1, 2008
Loading...

Share This Page