So, what I'm trying to do is create a function that switches uppercase characters to lowercase and vice-versa.
Here is what I'm working with:
#include <stdio.h>
#include <stdlib.h>
int caplowswitch(char string[], char switched[]);
int main(){
char name[] = "whyisthisnotworking";
char flipped[] = "";
caplowswitch(name, flipped);
return 0;
}
int caplowswitch(char word[], char switched[]){
char *ptrword = word;
unsigned short int counter = 0;
printf("Your text input is: %s \n", word);
while(*ptrword != NULL){
switched[counter] = (*ptrword ^ 0x20);
counter++;
ptrword++;
}
printf("Your flipped text is: %s \n", switched);
return 1;
}
In the process of learning. Thanks for your time.