Thursday, July 9, 2009

Wat is static and dynamic binding in C?

static is binding before run-time where as dynamic is binding during run-time.


e.g.


int my = 2;





Static binding means that whenever the


code refers to a particular symbol, variable, etc., after the program is compiled that symbol is hard-coded to point to a particular thing, so the computer doesn't have to waste time looking the thing up.





Dynamic binding means that programs have to make binding decisions, in some form, at run-time.


eg :


* using malloc() function you are allocating memory at runtime.


* When allocating value to function pointer at runtime.

Wat is static and dynamic binding in C?
http://www.cs.wustl.edu/~schmidt/PDF/C++...


No comments:

Post a Comment