سؤال

I wanted to write a code which makes a uppercase of first letter of string 1 and 3 and printing those.

  1. I tried the code below this but compiler gives İNVALİD CONVERSİON OF CHAR TO İNT
  2. 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;
    
    }
    
هل كانت مفيدة؟

المحلول

You need

*str1 = toupper(*str1);

...

Asssuming that str1 is a pointer to char (and include the appropriate header files)

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top