Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

HOW CAN ADD OUR FUNCTION IN LIBRARY.

Answer Posted / vignesh1988i

it's simple.....

just have ur function definition in one Cpp or C file.....ie save it as .cpp or .C file....
then include the file as #include "program.c"
and then wherever you need call that functionin an another program...
for example:
let me add my own ADDITION function in my library.....

this is my first file stored in .C....
int add(int a,int b)
{
int c;
c=a+b;
return c;
}
the file name for the above is add.c

then am opening my main program file in .c mode ....
#include<stdio.h>
#include<conio.h>
#include"add.c"
void main()
{
int a,b,c;
scanf("%d%d",&a,&b);
c=add(a,b);
printf("\n the added sum is :%d",c);
getch();
}



thank u

Is This Answer Correct ?    40 Yes 29 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is an operator?

1069


What is local and global variable in c?

1194


What is 02d in c?

1071


What is substring in c?

1200


What is a string?

1109


What is an expression?

1051


any limit on the number of functions that might be present in a C program a) max 35 functions b) max 50 functions c) no limit d) none of the above

1044


Explain what are the different data types in c?

1214


What are the advantages of Macro over function?

2002


How #define works?

1098


What are the primitive data types in c?

1070


number of times a digit is present in a number

2037


Write a C program to accept a matrix of any size. Find the frequency count of each element in the matrix and positions in which they appear in the matrix

2000


How can I call a function with an argument list built up at run time?

1233


What are the 5 types of organizational structures?

1071