Forum Discussion
Altera_Forum
Honored Contributor
15 years agoYou also need to change this to:
char Sonar_Height ;
fgets stores a NUL in the last position and you called fgets with a count of 4. When it writes the 0 to Sonar_Height [3] you will overwrite a byte, possibly the return address crashing this function. Bill