Home > other >  Ask a about the inside of the structure function pointer assignment problem
Ask a about the inside of the structure function pointer assignment problem

Time:09-30

A few days ago to see a code, defines a structure typedef struct ()
{int a; Char b; Void (* p) (); } the test; Then there is a function of void fun (), defines a structure body array and assignment, inside the test table [10]={{1; 3; (* fun)},... }; I want to ask the assignment into the test table [10]={{1; 3; Fun},... }; The test table [10]={{1; 3; & Fun},... }; I can understand, but the assignment into such test table [10]={{1; 3; (* fun)},... }; Change how understanding, * fun this how to understand, is not very proficient in c language, hope to have a great god help me to analyze, and I tried it, this can be either three,

CodePudding user response:

* fun? Should not matter, this question makes me think of oneself to function in the form of stored in the memory, as well as the calling process is not clear, have to go to the plane plane book

CodePudding user response:

Structure inside the void (* p) (a) is a function pointer, is not a normal, * fun is a function pointer, on behalf of * p,

CodePudding user response:

A function pointer function addresses
  • Related