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,009
    Likes Received:
    203
    Trophy Points:
    63
    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

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice