skip to main | skip to sidebar

sahucpp

Tuesday, August 14, 2007

function pointer in c example

#include

typedef struct
{
void (*func)(int );
}myTest;

void show(int a)
{
printf("%d\n",a);
}

int main(void)
{
myTest tt;
int x=90;
tt.func = show;

tt.func(x);

return 0;
}
Posted by Haramohan Sahu at 9:45 AM

No comments:

Post a Comment

Newer Post Older Post Home
Subscribe to: Post Comments (Atom)

Blog Archive

  • ▼  2007 (28)
    • ►  October (6)
    • ►  September (3)
    • ▼  August (19)
      • Why do i need dynamic casting in c++?
      • Funtion return array of integer
      • Some more example of Function pointer.
      • Can i cast char* to a unsigned char* or vice versa ?
      • What is make file and what it does ?
      • c++ links
      • Problem with Implicit conversion
      • Explicit Constructors
      • How to Avoid Complex Declarations
      • Problem with your Key Boad ,No proble, there is a...
      • Function returning Pointer to array of function po...
      • Function returning a pointer to a function
      • What Is a Function Pointer
      • How to read function pointer ,sahu has one formula...
      • function pointer in c example
      • Function Pointer in a class or stucture
      • sed command 's use
      • grep command
      • unix stuffs