R
raashid bhatt
hi
by the definition of inline functions
"In computer science, an inline function is a programming language
construct used to suggest to a compiler that a particular function be
subjected to in-line expansion; that is, it suggests that the compiler
insert the complete body of the function in every context where that
function is used."
========================================
int a;
inline void func()
{
a = 50;
}
void __cdecl main()
{
func();
func();
}
===========================================
so the complete body of function func() should actually be placed from
where it is called ... ie this code is similar to
============================================
int a;
void __cdecl main()
{
a = 50;
}
============================================
but when i compile it i get undesired results
PUSH EBP
MOV EBP,ESP
CALL FUNC
; THE FUNCTION SHOULD NOT BE CALLED RATHER THE WHOLE BODY OF FUNCTION
SHOUDL BE PLACED HERE
CALL FUNC // SAME HERE
POP EBP
RETN
if i made func as inline then why is it called why not the body of
func is placed at every place it called.
Raashid Bhatt (a.k.a rash0r)
by the definition of inline functions
"In computer science, an inline function is a programming language
construct used to suggest to a compiler that a particular function be
subjected to in-line expansion; that is, it suggests that the compiler
insert the complete body of the function in every context where that
function is used."
========================================
int a;
inline void func()
{
a = 50;
}
void __cdecl main()
{
func();
func();
}
===========================================
so the complete body of function func() should actually be placed from
where it is called ... ie this code is similar to
============================================
int a;
void __cdecl main()
{
a = 50;
}
============================================
but when i compile it i get undesired results
PUSH EBP
MOV EBP,ESP
CALL FUNC
; THE FUNCTION SHOULD NOT BE CALLED RATHER THE WHOLE BODY OF FUNCTION
SHOUDL BE PLACED HERE
CALL FUNC // SAME HERE
POP EBP
RETN
if i made func as inline then why is it called why not the body of
func is placed at every place it called.
Raashid Bhatt (a.k.a rash0r)