How to subtract a set value from each character in an array?

this function subtracts a given value for each element in an array. I
\ If the array is: hellohowareyou, and the value is 6
then result will be : 6 characters from each letter in the initial array

and the prototype of it is:

void minusFromArray(char arr[], int size, int value);

how do i convert each element in the array into ascii and subtract the values from those ascii characters?
Last edited on
you do not need to:
1
2
3
4
char arr[4] = "bcd";
for(int i = 0; i < 3; ++i)
    arr[i] -= 1;
std::cout << arr;
Will output:
abc


Last edited on
Topic archived. No new replies allowed.