Meu código executa duas vezes o laço for
e não executa mais nem mesmo o que eu colocar depois da chamada da função stringToUpper()
dentro da main()
, ou o que eu colocar depois do laço for
.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
void stringToUpper(char str[]){
for(int i = 0; i<strlen(str); i++){
if(str[i]>=97 && str[i]<=122){
str[i] = str[i] - 32;
}
}
printf("%s\n", str);
}
int main(){
stringToUpper("All your BASE are Belong to US!");
return 0;
}