1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

need help to wrote a c program.

Discussion in 'C' started by ananya1, Aug 16, 2010.

  1. ananya1

    ananya1 New Member

    Joined:
    Aug 16, 2010
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    hello ppl..can u plz help me in writing a program to calculate the sum of two binary numbers. function prototype shud b char* add(char* n1,char* n2)
     
  2. xpi0t0s

    xpi0t0s Mentor

    Joined:
    Aug 6, 2004
    Messages:
    3,012
    Likes Received:
    203
    Trophy Points:
    0
    Occupation:
    Senior Support Engineer
    Location:
    England
    This is not difficult. How far have you got and where are you stuck? How do you plan to handle numbers of different lengths, e.g. add("101","1000"); ? Also does the return value (a char*) point to memory allocated by add(), and if so who is responsible for freeing that memory?
     

Share This Page