#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2010
    Posts
    16
    Rep Power
    0

    Purpose of a function


    Hello all,

    func(int* a, int b)
    {
    while((*a&(1 << b))==0);
    }


    Can someone tell me the hidden purpose of this function?

    Thanks

    Comments on this post

    • salem disagrees : Stop wasting the time of everyone on the net
  2. #2
  3. Lord of Dorkness
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jan 2004
    Location
    Central New York. Texan via Arizona, out of his element!
    Posts
    8,524
    Rep Power
    3314
    Yes, although it isn't hidden. You should review pointers, the while construct, and bit operations. First, though, you should review the "New users - HOW TO POST A QUESTION - READ THIS FIRST" thread.
    Functionality rules and clarity matters; if you can work a little elegance in there, you're stylin'.
    If you can't spell "u", "ur", and "ne1", why would I hire you? 300 baud modem? Forget I mentioned it.
    DaWei on Pointers Politically Incorrect.
  4. #3
  5. Contributed User
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    Jun 2005
    Posts
    4,379
    Rep Power
    1871
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper

IMN logo majestic logo threadwatch logo seochat tools logo