Velneo - apuntadores y funciones

 
Vista:

apuntadores y funciones

Publicado por leslie (1 intervención) el 23/11/2017 00:12:21
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
main(){
int k;
 
Inventario tienda;
printf("Cuantos productos vas ingresar?");
scanf("%d", &k);
 
creainventario(&tienda, k);
genera_lista (Inventario *indice);
Producto creallenaestructura(nombre, existencia, precio, stock);
solicita_info();
llenainventariotni(&tienda, k);
imprime_inventario(tienda);
menuModifica();
 
crea_arreglo(k);
imprime_arreglo(tienda);
Modifica(&tienda);
buscar(tienda,k);
compara(nombre, char *buscado);
}
 
void genera_lista(Inventario *indice){
int i;
 
    for(i=0; i<indice ;i++){
    Inventario.indice = valida_existencia;
    }
}
 
int valida_existencia(Producto a ){
return (-1)*(a.existencia-a.stock);
}
Producto creallenaestructura(char *nombre, int exist, double precio, int stock){
Producto nuevo;
strcpy(nuevo.nombre, nombre);
nuevo.existencia=exist;
nuevo.precio=precio;
nuevo.stock=stock;
return nuevo;
}


me marca estos errores:
C:\Users\porta\Downloads\prac.c In function 'main':
[Error] expected expression before 'Inventario'
[Error] expected expression before 'char'
[Error] incompatible type for argument 1 of 'compara'
[Note] expected 'Producto' but argument is of type 'void (*)(int, int)' [Error] 'opc' undeclared (first use in this function) [Note] each undeclared identifier is reported only once for each function it appears in
In function 'modificaNombre':
[Warning] passing argument 1 of 'strcpy' from incompatible pointer type
In file included from C:\Users\porta\Downloads\prac.c
[Note] expected 'char * __restrict__' but argument is of type 'void (*)(int, int)'
[Warning] passing argument 2 of 'strcpy' makes pointer from integer without a cas
[Note] expected 'const char * __restrict__' but argument is of type 'char'
[Error] assignment to expression with array type
C:\Users\porta\Downloads\prac.c In function 'genera_lista':
[Warning] comparison between pointer and integer
[Error] expected identifier or '(' before '.' token
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder