Ver Mensaje Individual
  #1 (permalink)  
Antiguo 10/04/2011, 17:31
Avatar de Geekne
Geekne
 
Fecha de Ingreso: marzo-2011
Ubicación: Donde estoy? Washing you.
Mensajes: 30
Antigüedad: 13 años, 1 mes
Puntos: 0
¿Porque me sale este error...?

tengo el siguiente codigo:

Código C:
Ver original
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. typedef salario[10];
  5. typedef struct{
  6.  
  7.     char codigop;
  8.     float presupuestop;
  9.  
  10. }cantpry[20];
  11.  
  12. typedef struct{
  13.    
  14.     char nombre[30];
  15.     char apellido[30];
  16.     salario pagose;
  17. }cantemple;
  18.  
  19. typedef struct{
  20.  
  21.     char nombredepto[30];
  22.     char codigo[20];
  23.     cantemple empleados;
  24.     cantpry proyectos;
  25. }departamentos;
  26.  
  27.  
  28. main(){
  29.  
  30. int cantidaddeparta, i;
  31. FILE *ent;
  32. departamentos depar[20];
  33.    
  34. ent=fopen("InfoDepto.txt", "r");
  35.  
  36. fscanf(ent, "%d\n", &cantidaddeparta);
  37. printf("\n%d\n", cantidaddeparta);
  38.  
  39. for(i=0;i<=cantidaddeparta;i++){
  40.     fscanf(ent, "%s", &depar.nombredepto);
  41. }
  42.  
  43. fclose(ent);
  44.  
  45. }

&e sale este error: error: request for member ‘nombredepto’ in something not a structure or union

Porque sera?
__________________
Software libre rocks lml