mail the ans on (email removed)
how can I find the addres of function
Collapse
X
-
-
The name of a function is the address of the function.
You can just typecast the functon name to an int. -
-
-
An int may not be large enough to hold an address. I suggest you use a long int.
However, be aware that you are stepping into the realm of implementation-defined or undefined behavior. The Standard does not require a compiler to provide any integral types that can hold the value of a function pointer. In fact, a compiler is not required to provide a single pointer type that can hold both pointer-to-data and pointer-to-function.Code:long addr = &display; printf("address:=%lu\n",addr);Comment
Comment