Compilation error while return function pointers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I am getting the Compilation error below which in valid:
error: cannot convert `int (*)(float, float, int)' to `int
(test1::*)(float, float, int)' in return

Can i get rid of this by using cast operators? Please provide some
pointer regarding this.

I am adding the code snippet below as a reference.
================================================================
int test1::member_test1(float a, float b, int c)
{

       return (static_cast<int>(a) + static_cast<int>(b) + c);
}

/* Define a type which is a function pointer for function member_test1 */
typedef int(test1:: *t_member_fptr_test1)(float, float, int);


int func_test2(float a, float b, int c)
{

       return (static_cast<int>(a) + static_cast<int>(b) + c);
}


t_member_fptr_test1  func_return_ptr()
{
       return &func_test2;// Error here

}
===============================================================



--
with regards,
purnendu ghosh
-----------------------------------------------------------------------
If you can D.R.E.A.M it you can D.O it
-----------------------------------------------------------------------

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux