I want to know how to pass a struct array by reference in c

0

The problem is the following one I want to pass an array, struct array by reference to be able to fill my struct by means of a procedure

try it analogously to how it is normally done with an array

when compiling it tells me that the argument step 'fill' is of the pointer type is incompatible

and that 'struct questions is **'

This is the code

#include<stdio.h>

struct preguntas{

    char pregunta[40];
    char respuestas[40];
    char correcta[15];
};

void rellenar(struct preguntas *A[]);

int main (){
    struct preguntas quest[3];
    rellenar(&quest[3]);

    printf("%s",quest[0].pregunta);

    return 0;
}    

void rellenar(struct preguntas *A[3]){

    scanf("%s",A[0]->pregunta);
}
    
asked by Gabriel Perez 16.06.2018 в 01:56
source

0 answers