Post the modified source here (and please use code tags: [code]Your code here[/code])
Your problem is certainly this:
1 2
nome=newchar[16];
cognome=newchar[16];
nome and cognome now point to an uninitialized buffer with random content. strlen() cannot determine a valid length (where is the terminating 0?).
Better set both to NULL and check when you access the variables