azazel01 de Julio del 2003
PreguntaHola,
Mi pregunta es la siguiente:
¿sintácticamente y semánticamente el siguiente código está bien expresado? yo tengo algunas dudas.
struct registro{
int a;
int b;
};
void main (void){
struct registro x;
struct registro *y;
x.a=5;x.b=10;
y=(struct registro *)malloc(sizeof(struct registro));
y->a=x.b;
y->b=x.a;
}
Por favor si no es correcto,¿alguien me puede decir cual es el fallo?Gracias.
Mi pregunta es la siguiente:
¿sintácticamente y semánticamente el siguiente código está bien expresado? yo tengo algunas dudas.
struct registro{
int a;
int b;
};
void main (void){
struct registro x;
struct registro *y;
x.a=5;x.b=10;
y=(struct registro *)malloc(sizeof(struct registro));
y->a=x.b;
y->b=x.a;
}
Por favor si no es correcto,¿alguien me puede decir cual es el fallo?Gracias.
