writing a function that subtracts.

I have to write a function Subtracts val from each character in the array
// If the array is: abcdefghi and value = 5,
// then result is: 5 ascii characters subtracted from the given array
// note: Make sure the character remains in the ' '
// to '~' (inclusive)
// If character < ' ', then add 95
// If character > 126, then subtract 95
// to put back within the range, and repeat as needed
// all printable characters are between this range
// ' ' is the 1st printable character (32)
// '~' is the last printable character (126)
note: subtracting values from the char will cause an overflow.

the prototype is: void subtracting(char array[], int size, int value)
I have to write a function Subtracts val from each character in the array

Do you mean this? or this:
If the array is: abcdefghi and value = 5,
// then result is: 5 ascii characters subtracted from the given array
Please note, that it is not a homework site. We won't do your homework for you. However we are always willing to help solve problems you encountered, correct mistakes you made in your code and answer your questions.

We didn't see your attemts to solve this youself and so we cannot correct mistakes you didn't made and answer questions you didn't ask. To get help you should do something yourself and get real problems with something. If your problem is "I don't understand a thing", then you should go back to basics and study again. As it is impossible to find deriviative of function without knowledge in ariphmetics, you cannot do more complex tasks in programming without clear understanding of basics.

So, try to do this yourself and stop spamming with almost identical threads:
http://cplusplus.com/forum/general/95921/
http://cplusplus.com/forum/beginner/96023/
http://cplusplus.com/forum/general/96037/
This could get you banned.
Last edited on
ahahahahhahah nice one :D
Topic archived. No new replies allowed.