How do I initialize a pointer to a function?

Answers were Sorted based on User's Feedback



How do I initialize a pointer to a function?..

Answer / jaya prakash

return_type (*pointername)(arg list)

eg
void fnname();
void (*f)()=fnname;//ptr initialisation
//f is the poniter to fn printf

Is This Answer Correct ?    13 Yes 1 No

How do I initialize a pointer to a function?..

Answer / k.thejonath

void (*)f();
Here f if is pointer to a function having no arguments and
no return values.

Is This Answer Correct ?    7 Yes 8 No

Post New Answer

More C Interview Questions

Blade logic interview question. 1st round is a written tests with 15 multiple questions from c and c++. All are simple basic question. Like int main () { Int i=65; Return printf(ā€œ%cā€, i); } 2nd and 3rd round is technical interview. The position for which I was interview was core UNIX and c. Yes it is for system programming. The company has product name blade server. For their server they are creating their own command for their purpose. Example cd command. We can implement it in a c program by using the chdir() function. So the question asks related to PID, fork, pipe, shared memory, signal. Write a program in c which will act as cp command.

1 Answers   BladeLogic, Infosys,


Do you know the difference between malloc() and calloc() function?

0 Answers  


Write a function that accepts two numbers,say a and b and makes bth bit of a to 0.No other bits of a should get changed.

2 Answers   Scientific Atlanta, Wipro,


write a program to display all prime numbers

0 Answers  


What is the difference between a string copy (strcpy) and a memory copy (memcpy)? When should each be used?

0 Answers   Aspire, Infogain,






hi folks i m approching for h1 b interview on monday 8th of august at montreal and i m having little problem in my approval notice abt my bithdate my employer has made a mistake while applying it is 12th january and istead of that he had done 18 the of january do any body have any solution for that if yes how can i prove my visa officer abt my real birthdate it urgent please let me know guys thaks dipesh patel

0 Answers  


write a program without using main function?

2 Answers   TCS,


Is a house a shell structure?

0 Answers  


implement NAND gate logic in C code without using any bitwise operatior.

4 Answers   Alcatel,


what is the value of 'i'? i=strlen("Blue")+strlen("People")/strlen("Red")-strlen("green")

7 Answers   Cadence, JNTU, Zen Technologies,


Lists the benefits of c programming language?

0 Answers  


What is a loop?

0 Answers  


Categories