You need
*str1 = toupper(*str1);
...
Asssuming that str1
is a pointer to char (and include the appropriate header files)
Pergunta
I wanted to write a code which makes a uppercase of first letter of string 1 and 3 and printing those.
What is wrong with this code should i try with strlen and for loop? This is code;
int main()
{
char str1[] = "elektrik";
char str2[] = "ve";
char str3[] = "elektronik";
str1 = toupper(str1);
str3 = toupper(str3);
printf("%s %s %s",str1,str2,str3);
getch();
return 0;
}
Solução
You need
*str1 = toupper(*str1);
...
Asssuming that str1
is a pointer to char (and include the appropriate header files)