Avatar of zizi21
zizi21
 asked on

a char higher

hi,

lets say user input a string such as "this is a string" and the program should give back the value one higher than the given string...

example : this is a string

answer: uhis is a string

i am doing it like this;

++str[0];

is there any other way, the reason being is that when i change like that, i dont give the original str anymore ..i dont want to use buffer where i need strcpy, etc....
C

Avatar of undefined
Last Comment
zizi21

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Infinity08

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Infinity08

Of course, you can always add one the moment you output :

        printf("%c", str[0] + 1);
SOLUTION
ozo

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
zizi21

ASKER
yup..printf..
zizi21

ASKER
thanks
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck