//Function to store select_field
void store_field(int num_fields, unsigned long *lengths,
MYSQL_ROW row, char elect_type[10][100])
{
//Storing select_field below
int i,j,k,g;
for( i=1;i < num_fields;i=i+10)
{
// i+10 so that loop is executed one time only,
// i=1 bcoz 2nd entry is select_type
for (j=0;j<lengths[i];j++)
{
if (row[i] != NULL)
{
select_type[k][j] = *row[i];
row[i]++;
}
if (row[i] == NULL)
{
select_type[k][j]= '\0';
printf ( "NULL\n");
break; // row[i] is null for fields containing NULL
}
}
for (j;j<100;j++)
{
select_type[k][j]='\0';
}
// setting every other empty field in current row
// of select_type to NULL
}
k++;
}
g = k; //HERE I AM GETTING THE ERROR
for (k;k<10;k++){for(j=0;j<100;j++)
{
select_type[k][j]='\0';
}
}
我已经k
在函数中声明了,但我得到了错误。