Feature of function name:
1. Function name is constant pointer.
Example:
What will be output of following program?
#include<stdio.h>
void special();
int main(){
int main(){
special++;
special();
return 0;
}
void special(){
return 0;
}
void special(){
printf("HI");
}
Output: Error, Lvalued required.
Explanation: Function name is constant pointer. So you cannot increment function special.
2. Function name gives the address where it has defined.
#include<stdio.h>
int main(){
}
Output: Error, Lvalued required.
Explanation: Function name is constant pointer. So you cannot increment function special.
2. Function name gives the address where it has defined.
#include<stdio.h>
int main(){
int p,q;
cquestionbank();
printf("%u",cquestionbank);
return 0;
}
int cquestionbank(){
return 0;
}
int cquestionbank(){
printf("");
return 0;
}
Output: Address of function
3. We can rename the function name using typedef keyword.
}
Output: Address of function
3. We can rename the function name using typedef keyword.
No comments:
Post a Comment