Thread: pls help me!!

  1. #1
    Registered User
    Join Date
    Dec 2001

    Unhappy pls help me!!

    pls anyone who is kind enough to help on my problem about a certain program of mine about converting binary to decimal pls help me im begging to someone who read this pls .

    helpPPPPPPPPPPPPPPPP helpppppppppppppppppp
    help help help help help help help!!!!!!!!

  2. #2
    Registered User
    Join Date
    Nov 2001
    UM....One way is to have each binary number inputed to an int(or bool) array, then have the program see which array elements are set(1) and add those together. EX:

    user enters 100110
    You assign each value to a int[] element and then just say:
    for(i=0; i<sizeof(intarray); i++){
    if(intarray[i] == 1) {
    intarray[i] = pow(2, i); //reasign the array element for
    // the decimal number to conserve memory.

    Then addup all the intarray values and you will have a decimal number. I think this method will work, but I didn't try it.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Basic port scanner code .. pls help ???
    By intruder in forum C Programming
    Replies: 18
    Last Post: 03-13-2003, 08:47 AM
  2. i dont know what to do. pls. help!!!!
    By Unregistered in forum C++ Programming
    Replies: 14
    Last Post: 03-14-2002, 03:24 PM
  3. help me pls..... :(
    By mocha_frap024 in forum C++ Programming
    Replies: 2
    Last Post: 02-22-2002, 10:46 AM
  4. C programming - pls pls help me
    By sally arnold in forum C Programming
    Replies: 10
    Last Post: 01-16-2002, 04:55 AM
  5. Pls Help Me In This Question!!!
    By Joanna in forum Windows Programming
    Replies: 1
    Last Post: 10-20-2001, 02:05 PM