fork(1) download
  1. #include <string.h>
  2. #include <stdio.h>
  3.  
  4. int main()
  5. {
  6.  
  7. const char *word = "UpPeRcAsE";
  8.  
  9. char DuplicateArray[45];
  10. int sizevalue = strlen (word);
  11.  
  12. strncpy(DuplicateArray, word, sizevalue);//word is the const char pointer.
  13. DuplicateArray[sizevalue] = '\0';
  14. int i = 0;
  15. while ( DuplicateArray[i] != '\0' )
  16. {
  17. DuplicateArray[i] = tolower(DuplicateArray[i]);
  18. i++;
  19. }
  20.  
  21. printf("Before: %s, after: %s\n", word, DuplicateArray);
  22.  
  23. return 0;
  24. }
  25.  
Success #stdin #stdout 0s 1788KB
stdin
Standard input is empty
stdout
Before: UpPeRcAsE, after: uppercase