What does writing in the C language of the form mean?

int (*xNext)(sqlite3_vtab_cursor*); 

This is a structure field, but what does it mean? I did not find this in the textbooks. I am not a C programmer, but I am trying to write a wrapper for the library.

2 answers 2

xNext is the name of the structure field (identifier).

int (*)(sqlite3_vtab_cursor*) - the type of this field: a pointer to a function, which accepts a pointer to a cursor object and returns an int .

Pointers to functions are, in fact, the only possible functional objects in C, that is, those that can be executed by int next = obj.xNext(cursor); brackets to the right: int next = obj.xNext(cursor);

  • for example, int (* xUpdate) (sqlite3_vtab *, int, sqlite3_value **, sqlite3_int64 *); function accepts a pointer. pointer to pointer and third pointer? - yuriy
  • @yuriy: based on your comment it becomes clear that the 1st and 2nd parameters are input, and the 3rd and 4th days off. Those. if the function is executed successfully, it will fill the sqlite3_value structure with data (memory allocation may lie on you / or not) and also write some value to sqlite3_int64 . - LLENN pm
  • @yuriy Between the first two pointers, the int still busy. - bipll 2:41 pm
  • @bipll yes, I missed, I oversawed behind the monitor already) - yuriy

int (*xNext)(sqlite3_vtab_cursor); is a variable of type pointer to function. int (xNext)(sqlite3_vtab_cursor); - preliminary announcement of the function.