Is it possible anyhow to increment ASCII value of a char in C? Let's say I have following code
int main(){
char *a = "This is my test string";
/* *(a+12) += 21; This isnt going */
printf("%c = %c\n", *(a+12), *(a+12)+21);
printf("%s\n", a);
return 0;
}
What I want, for example, is to increment the e
character with 21 which would be z
and make it permanent inside that array. So when I use printf
on the array, it prints z
on that place instead of e
.
How would we go about this?