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
What is the size of enum in c?
What are the disadvantages of external storage class?
what type of questions arrive in interview over c programming?
Tell me what is null pointer in c?
Should I learn c before c++?
What do you mean by dynamic memory allocation in c? What functions are used?
I have a varargs function which accepts a float parameter?
The % symbol has a special use in a printf statement. Explain how would you place this character as part of the output on the screen?
What does the function toupper() do?
What are local static variables? How can you use them?
What is wrong in this statement? scanf(ā%dā,whatnumber);
What is huge pointer in c?
Write a program to implement a round robin scheduler and calculate the average waiting time.Arrival time, burst time, time quantum, and no. of processes should be the inputs.
Give basis knowledge of web designing ...
An integer that indentifies the position of a data item in a sequence of data items a) value b) number c) index d) all of the above