Ver Mensaje Individual
  #1 (permalink)  
Antiguo 16/05/2013, 19:45
Bael_Balzac
 
Fecha de Ingreso: julio-2011
Mensajes: 62
Antigüedad: 12 años, 9 meses
Puntos: 0
Pregunta Inicializar struct

Cuantas formas de inicializar un struct existen, porque la línea 14 esta mal ?
Código C:
Ver original
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. struct elemento{
  5.        char nombre[3];
  6.        double fem;
  7.        double df;
  8. };
  9.  
  10. int main()
  11. {
  12.     struct elemento barra1;
  13.     struct elemento barra2 = {"AB", 0.45, 25.0};
  14.     barra1 = {"BC", 0.57, 29.0};
  15.    
  16.     return 0;
  17. }