Jump to content

Parse error


pudim
 Share

Recommended Posts

case 'O': {

  Data d;

  printf("Este comando verifica se uma data é válida:\n=> ");

  d=le_data();

  printf("\n=> ");

  if (valid_data(Data d))

  return OK;

  else

  return Invalida;

  break;}

Estou a fazer um programa com comandos. Aqui está o comando O (case O). Contudo, o programa não corre  devido ao seguinte erro:      projecto.c:163: error: parse error before "Data"

Se alguém me puder ajudar agradecia.

Link to comment
Share on other sites

Ja solucionei esse problema. Obrigado.

Agora surgiu-me outro:

case 'O': {

  Data d;

  printf("Este comando verifica se uma data e valida:\n=> ");

  d=le_data();

  printf("\n=> ");

  if (valid_data(d))

  printf("OK.\n");

  else

  printf("Invalida.\n");

  break;}

Quando abro a consola e introduzo uma data inválida: "20091315" por exemplo não aparece "Inválida", simplesmente muda de linha. No entanto, quando ponho uma data válida por exemplo "20091215" já me á OK.

Se alguém me puder ajudar agradecia.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.