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 / raje

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();
}

Is This Answer Correct ?    10 Yes 12 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can we initialize extern variable in c?

1132


What is a pointer in c plus plus?

1302


what is the format specifier for printing a pointer value?

1018


Without Computer networks, Computers will be half the use. Comment.

2296


How will you print TATA alone from TATA POWER using string copy and concate commands in C?

1372


WHICH TYPE OF JOBS WE GET BY WRITING GROUPS .WHEN THE EXAMS CONDUCTED IS THIS EXAMS ARE CONDUCTED EVERY YEAR OR NOT.PLS TELL ME THE ANSWER

1858


what do you mean by inline function in C?

1051


What is the difference between array and linked list in c?

1149


Why c is a procedural language?

1052


What is a void pointer? When is a void pointer used?

1060


What is the purpose of type declarations?

1114


What is the advantage of using #define to declare a constant?

1096


what is the height of tree if leaf node is at level 3. please explain

2149


Difference between strcpy() and memcpy() function?

1141


Explain what happens if you free a pointer twice?

1076