Cambia i vari confronti tipo testo[i] == "." con testo[i] == '.'

Su cosa stai studiando C? La differenza tra "A" e 'A' è veramente roba "base"