What is function pointer and where we will use it
Answers were Sorted based on User's Feedback
Answer / raghanna
A function pointer is a variable that stores the address of a function that can later be called through that function pointer. This is useful because functions encapsulate behavior. For instance, every time you need a particular behavior such as drawing a line, instead of writing out a bunch of code, all you need to do is call the function.
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / bsreddi
A function pointer is a type of pointer in C, C++ and other
C-like programming languages. When dereferenced, a function
pointer invokes a function, passing it zero or more
arguments just like a normal function. In programming
languages like C, function pointers can be used to simplify
code, such as replacing large switch statements.
| Is This Answer Correct ? | 5 Yes | 5 No |
What are the advantages of using macro in c language?
why programming language C is still used in operating system's kernel??
What is data structure in c programming?
What is floating point exception error? And what are different types of errors occur during compile time and run time? why they occur?
Write a C program linear.c that creates a sequence of processes with a given length. By sequence it is meant that each created process has exactly one child. Let's look at some example outputs for the program. Here the entire process sequence consists of process 18181: Sara@dell:~/OSSS$ ./linear 1 Creating process sequence of length 1. 18181 begins the sequence. An example for a sequence of length three: Sara@dell:~/OSSS$ ./linear 3 Creating process sequence of length 3. 18233 begins the sequence. 18234 is child of 18233 18235 is child of 18234 ........ this is coad .... BUt i could not compleate it .....:( #include <stdio.h> #include <sys/types.h> #include <unistd.h> #include <stdlib.h> int main(int argc, char *argv[]) { int N; pid_t pid; int cont; if (argc != 2) { printf("Wrong number of command-line parameters!\n"); return 1; } N = atoi(argv[1]); printf("Creating process sequence of length %d.\n",N); printf("%d begins the sequence.\n",getpid()); /* What I have to do next ?????? */ }
what is the difference between #include<stdio.h> and #include"stdio.h" ?
If errno contains a nonzero number, is there an error?
Are global variables static in c?
Which of these functions is safer to use : fgets(), gets()? Why?
What are Storage Classes in C ?
32 Answers CTS, HP, IBM, Maharaja Whiteline, Tamil Nadu Open University TNOU, TATA, TCS, Wipro,
I just typed in this program, and it is acting strangely. Can you see anything wrong with it?
main() { int a=4,b=2; a=b<<a + b>>2; printf("%d", a); }