if function is declared as static in one source file, if I
would like to use the same function in some other source
file...is it possible....how ?
Answers were Sorted based on User's Feedback
Answer / lakshman
using function pointer in main.c which holds address of
static function in the same file. But function pointer can
be used in other files.
|Is This Answer Correct ?||26 Yes||5 No|
It is possible. follow the guidelines below.
1.create a .c file called mai.c. and Its content is,
printf("In static fucntion");
2.create another file called test.c. And its content is
printf("In normal function \n");
3.have a .h file called Header.h and its content is,
Now main.c has a function with static key word(ie., static
func()). And its prototype and definition is available in
the same file and the same function name without static is
exist in the test.c and its prototype is there in the
When u run the program and control hits func() in main.c it
will call the static function in the same file.
When control hits next line ie., func1() it will call the
fuction func(), which is there in the test.c file(and also
there in main.c with static key word).
Now the output will be,
In static fucntion
In normal function
|Is This Answer Correct ?||9 Yes||41 No|
What's wrong with the call "fopen ("c:\newdir\file.dat", "r")"?
How can I increase the allowable number of simultaneously open files?
Concat two string with most overlapped substring has to remove "abcd"+ "cdef" = "abcdef
How can I read a directory in a C program?
how i m write c program 1.check prime number 2.prime number series
Write a program for the following series? 1 121 12321 1234321 123454321 12345654321 1234567654321 123456787654321 12345678987654321 1234567890987654321 123456789010987654321 12345678901210987654321 1234567890123210987654321 .........1234321............ ..........123454321............ ..........12345654321............ 7 8 9 0 1 Pls............?
How to print "Hi World" without using semi colon?
What is a Genralised LInked List?? Please give a detailed explation of it..
Write a c program using for loop to print typical pattern if number of rows is entered by keyboard. ABCBA AB BA A A
Write a Program to print this triangle: * ** * **** * ****** * ******** * ********** use two nested loops.
. A database table called PERSON contains the fields NAME, BASIC and HRA. Write a computer program to print a report which employee name and total salary for those employees whose total salary is more than 10,000. Total Salary = BASIC + HRA. At the end, the program should also print the total number of employees whose total salary is more than 10,000.
write a program in 'c' to find the value of p[i+1]^n.p,i,n are arguments of a macro and n is a integer