Seems to work fine for me:

Code:
Qual o nome do ficheiro a criar? telmo
   Menu

1 --> Listar
2 --> Adicionar
3 --> Editar
4 --> Remover
5 --> Sair
2
Quantos testes deseja inserir?1
Insira o numero do teste: 2
2Insira a nota: 3.0
3.00Insira detalhes(pratica, teoria...): hello

Todos os dados relativos aos testes foram inseridos.
****************************************************
   Menu

1 --> Listar
2 --> Adicionar
3 --> Editar
4 --> Remover
5 --> Sair
5
A fechar o programa!
Code:
// telmo.txt

2
3.00
hello
I also did a test case with 6 additions, which also worked.

Are the values printing to the screen as expected? Are you entering "5" as the menu choice when you're done with menu choice 2? If so, are the exit prompts occurring as expected?

I also suggest you put the "menu()" call into a loop in "main()". As it is, you are approaching a strange sort of recursion, where "menu()" calls a function, that function calls "menu()" at the end, and so on.