need help to wrote a c program.

ananya1's Avatar, Join Date: Aug 2010
Newbie Member
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)
xpi0t0s's Avatar, Join Date: Aug 2004
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?