I need to do a function that takes two strings, and change both of them. But if you have a capital letter at the first, the time to convert must be lowercase. I tried to do it, but I think it's wrong inside my while
. What can I do?
Note: I can not use functions from 'string.h'.
void str_troca(char origem[], char minusc[])
{
char aux[MAX];
int i=0;
int a=1;
int b=0;
while(origem[i]!='void str_troca(char origem[], char minusc[])
{
char aux[MAX];
int i=0;
int a=1;
int b=0;
while(origem[i]!='%pre%')
{
if(origem[i]>64 && origem[i]<91)
{
origem[i]-32;
}
i++;
}
aux[i]=origem[i];
origem[i]=minusc[i];
minusc[i]=aux[i];
printf("%s\n",minusc );
printf("%s\n",origem );
}
')
{
if(origem[i]>64 && origem[i]<91)
{
origem[i]-32;
}
i++;
}
aux[i]=origem[i];
origem[i]=minusc[i];
minusc[i]=aux[i];
printf("%s\n",minusc );
printf("%s\n",origem );
}