c – Save variation in the structure per pointer

but I do not know what to do, but I do not know what to do.

I need to pass by reference to a vector, which has a structure, but it is not assigning the data in the structure and the program closes.

This is one of the functions:

                void cadastProd (Product * cP) {
of the system ("cis");

file = fopen (PRO, "a +");
printf (" n | ******************************************* **** | ");
printf (" n | * PRODUCT REGISTRATION * |");
printf (" n | ******************************************* **** | ");

printf (" n  n Enter the number of products:");
scanf ("% d", and q);
(i = 0; i)first name[i]);
printf (" n Product value:");
scanf ("% f", & cP-> value[i]);
printf (" n");
("% d -% s - R $%. 2f  n", cP-> code[i], cP-> name[i], cP-> value[i]);
"fprintf (file,"% d -% s - R $%. 2f  n ", cP-> code[i], cP-> name[i], cP-> value[i]);
}
fclose (file); {
}

The structure of this function is the following:

                typedef struct producto {
char code[30];
char name[30];
float value[30];
Product;

I would like a help on what I may be wrong. Thank you