
Envoyé par
Fooshi
Pourquoi pas ... en tout cas je ny aurais jamais pensé ! merci
Autre probleme malgré tout, voici ma structure :
1 2 3 4 5 6 7 8 9
| struct sql_result
{
int nrows; // Number of rows returned by the query.
int ncolumns; // Number of columns returned by row description.
struct sql_att_desc * att_desc; // A pointer to a row description.
struct sql_att_value ** rows; // Each sql_result is an array of sql_att_value.
int row_array_size; // Allocated size of rows array.
int binary; // Binary row values if binary == 1, otherwise Text.
}; |
J'initialise ma structure comme ceci :
1 2 3 4 5 6 7
| static int
sql_get_row_description( struct sql_connection * sql_conn, const char * msg )
{
struct sql_result result;
sql_make_empty_sql_result(&result); // Initilisation de la structure
...
} |
Mais comment initialiser les pointeurs sur les autres structures att_desc et rows ?
Ben soit tu les initialises toi-même
result.att_desc=<pointeur_valide ou NULL>
Soit tu le passes à une fonction qui s'en chargera
Avec toto définie ainsi
1 2 3 4
| <type> toto(struct sql_att_desc** ptr)
{
...
} |
Partager