Is there a way to find out the address of main() in C or C++ ? Since it is itself a function ,would there be an address of it own ?
I wasn't 100% sure whether the question was meant from within a program using C/++ or to retrieve address of the main()
function created with C/C++ (meaning from the command line).
Since it looks like you've received several good answers on how to get the address from within the program, I thought I'd mention you can get this info from nm
as well.
nm program|grep main