Like Tree1Likes
  • 1 Post By laserlight

what "bitand" do ???

This is a discussion on what "bitand" do ??? within the C++ Programming forums, part of the General Programming Boards category; hello what does "bitand" do in c++ code ? what is that mean : (object_name bitand variable_name)...

  1. #1
    Registered User
    Join Date
    Mar 2012
    Posts
    26

    what "bitand" do ???

    hello
    what does "bitand" do in c++ code ?


    what is that mean : (object_name bitand variable_name)

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    21,931
    bitand means &

    Just another name, so unless you need it, you might as well use &.
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  3. #3
    Registered User
    Join Date
    Mar 2012
    Posts
    26
    Thank You Laserlight,

    what is that mean : (object_name bitand variable_name) ?

  4. #4
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    21,931
    Oh, then you should read about bit shifting and bitwise operations.
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  5. #5
    Registered User
    Join Date
    Mar 2012
    Posts
    26
    What is that mean :
    class_name bitand operator = (const class_name bitant)


    Thanks laserlight

  6. #6
    Registered User
    Join Date
    Mar 2012
    Posts
    26
    But an object is not a variable ! . it is not possible to do bit wise with an object .

  7. #7
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    21,931
    Quote Originally Posted by codewriter
    What is that mean :
    class_name bitand operator = (const class_name bitant)
    Do you have any special reason to use bitand instead of & when I already recommended just using &? Are you learning C++ through a book or something? If so, which book?

    Quote Originally Posted by codewriter
    But an object is not a variable ! . it is not possible to do bit wise with an object .
    The term "object" can include objects of built-in types like int. But you probably have objects of class type in mind, in which case there is operator overloading.
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  8. #8
    Registered User
    Join Date
    Mar 2012
    Posts
    26
    This a part of the code :
    bool DrawRect(const TRect bitand SrcRect, int x, int y)

  9. #9
    Registered User
    Join Date
    Mar 2012
    Posts
    26
    TRect is a name of a class

  10. #10
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    21,931
    Please answer my questions.

    The problem is that this should be a fairly easy question to answer, as long as you have had a proper introduction to C++. Otherwise, my answer will be meaningless to you except as an answer to a trivia question.
    oogabooga likes this.
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  11. #11
    - - - - - - - - oogabooga's Avatar
    Join Date
    Jan 2008
    Posts
    2,808
    If bitand is exactly the same as & (whether meaning bitwise-and, address-of or reference) then
    Code:
    class_name bitand operator = (const class_name bitand)
    is just a really stupid way of saying
    Code:
    class_name& operator=(const class_name&)
    The cost of software maintenance increases with the square of the programmer's creativity. - Robert D. Bliss

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 9
    Last Post: 03-31-2009, 04:23 PM
  2. Replies: 46
    Last Post: 08-24-2007, 04:52 PM
  3. "itoa"-"_itoa" , "inp"-"_inp", Why some functions have "
    By L.O.K. in forum Windows Programming
    Replies: 5
    Last Post: 12-08-2002, 07:25 AM
  4. "CWnd"-"HWnd","CBitmap"-"HBitmap"...., What is mean by "
    By L.O.K. in forum Windows Programming
    Replies: 2
    Last Post: 12-04-2002, 06:59 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21