Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to get the size of the function?

Status
Not open for further replies.

sulacco

Technical User
Nov 8, 2002
74
RU
How do one can get the size of the function before compilation. And it's starting address in memory?
w.d.r. sulacco.
 
What are you trying to do - roll your own dynamic link library?

Noting that your previous question was about function pointers...

> And it's starting address in memory?
This is the function name, as previously stated.

As for the size of a compiled function, I'll leave that to someone else who is more familiar with this compiler.

--
 
You can't know the size of a function before compilation, because the size could vary depending on the compiler settings. For example, if you set the compiler to optimize for size, the function could be smaller than if the compiler is set to optimize for speed.
 
Thx, Salem, I forgot you'll already answered the question of
pointers. I've read that you can compute the size of the
function by using next function.
like this
func(){

}
func2(){
}
int size=func2-func; But you have to make some option to
compiler like this /ORDER.

Thx. ppl.
 
As for you question what i'm trying to do. Well, I'm just trying to figure out an article on CodeGuru.com.
if you are interested I can send you this. It's about some
system programming. The site is good.
w.d.r. sulacco.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top