   Short Question on Function Pointers
  HelloI know how to use standard function pointers in C++.eg;float (*funcpointer1)(arg1, arg2);void  (*funcpointer2)(arg1, arg2);but how to declare other non-primitive type like return type of self-defined structure or CALLBACK (which I need)struct Vector {...};Vector   (*funcpointer2)(arg1, arg2);  // doesn't workCALLBACK (*funcpointer1)(arg1, arg2);  // doesn't workCan anyone tell me how to use CALLBACK function pointers (or any other return-type which isn't standard void, float etc )   
  Take a look at boost. The source code, once you wrap your head around it, is highly valuable   ;  I would rather not be working with additional includes.Can't it be fixed without some external library ?;  What compiler are you using? One thing I could see as being a problem about a struct named CALLBACK is that some compilers define CALLBACK to be __stdcall, or some other function calling convention. The following code works fine for me#include <iostream>struct foo{int a;};foo (*func1)( int );foo myFunc( int a ){foo my_foo;my_foo.a = a;return( my_foo );}int main(int,char**){func1 = myFunc;foo my_foo = (*myFunc ) ( 24 );std::cout << my_foo.a << std::endl;return 0;}Perhaps you could tell us what compiler errors are preventing that code from working for you.[edit]Ok, upon re-reading your post I realized you are trying to use the CALLBACK calling convention...here is how I would have to redefine my functions for that#include <iostream>struct foo{int a;};// I don't remember where CALLBACK is defined so for // this example I'll just define it myself..#ifndef CALLBACK#define CALLBACK __stdcall#endif // calling conventions go in the parenthesisfoo (CALLBACK *func1)( int );foo CALLBACK myFunc( int a ){foo my_foo;my_foo.a = a;return( my_foo );}int main(int,char**){func1 = myFunc;foo my_foo = (*myFunc ) ( 24 );std::cout << my_foo.a << std::endl;return 0;}