Thread: Need Help with Bitwise actions!

  1. #1
    gg
    Guest

    Angry Need Help with Bitwise actions!

    Hi

    I have an exam in C tomorrow, and Im completley lost when it comes to bitwise manipulation. Yes, I am a begginer.

    The question goes like this:
    I need to write a program that will recevie an order of Pizza. The order includes up to 8 extras,
    I need to save the order in one character and then print it for confirmation.

    I understand that I need to "Or it with 1" whenever an extra is chosen, but I do not know how to retreive the extra combination chosen.

    Please help!

    gg

  2. #2
    Registered User Nutshell's Avatar
    Join Date
    Jan 2002
    Posts
    1,020
    That doesn't look that hard. You can also use a mask of
    1000000 00000000 00000000 00000000

    and just store it either as one or zero as you move along the bits by shifting...

  3. #3
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,829
    >>> I have an exam in C tomorrow

    and

    >>> I am a begginer

    Surely, to do an exam in something pre requires that you have completed a course... and done your coursework... doesn't it?
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

  4. #4
    The Artful Lurker Deckard's Avatar
    Join Date
    Jan 2002
    Posts
    633
    There was a fairly detailed thread about bitwise operators just last month. Do a forum seach and you might just pass your exam ;)
    Jason Deckard

  5. #5
    gg
    Guest

    Lightbulb

    Thank you all

    I had a weak moment. I finally figured it out.

    see ya

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Bitwise Operators
    By rrc55 in forum C Programming
    Replies: 6
    Last Post: 04-30-2009, 11:37 AM
  2. Bitwise Questions
    By someprogr in forum C Programming
    Replies: 8
    Last Post: 12-14-2008, 05:45 PM
  3. bitwise operations with double
    By henry_kay in forum C Programming
    Replies: 2
    Last Post: 10-03-2007, 04:57 AM
  4. C bitwise operator exercise - more like newb killer
    By shdwsclan in forum C Programming
    Replies: 3
    Last Post: 02-22-2006, 06:02 AM
  5. Characters into bitwise ints
    By Code Zer0 in forum C++ Programming
    Replies: 9
    Last Post: 04-24-2003, 08:34 AM
Website Security Test