fork download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int caplowswitch(char string[], char switched[]);
  5.  
  6. int main(){
  7.  
  8. char name[] = "WHYISTHISNOTWORking";
  9. char flipped[100] = "";
  10.  
  11. caplowswitch(name, flipped);
  12.  
  13.  
  14. return 0;
  15. }
  16.  
  17. int caplowswitch(char word[], char switched[]){
  18.  
  19. char *ptrword = word;
  20. unsigned short int counter = 0;
  21.  
  22. printf("Your text input is: %s \n", word);
  23.  
  24. while(*ptrword != '\0'){
  25.  
  26. switched[counter] = (*ptrword ^ 0x20);
  27. counter++;
  28. ptrword++;
  29.  
  30. }
  31.  
  32. switched[counter] = '\0';
  33.  
  34. printf("Your flipped text is: %s \n", switched);
  35.  
  36. return 1;
  37. }
  38.  
Success #stdin #stdout 0s 2292KB
stdin
Standard input is empty
stdout
Your text input is: WHYISTHISNOTWORking 
Your flipped text is: whyisthisnotworKING