How to decrease a string number by one in C?

If i have a macro called NUM which is "8" (string) for example
How do I make it into say "7", well i just want to lower it by one, also there will never be the case where its "0" and i have to decrease it.
there is no guarantee how many digits NUM could have, but will always be an integer.
How do I do the conversion?

Maybe the following link can help
atoi
http://pubs.opengroup.org/onlinepubs/009695399/functions/strtol.html

And sprintf() to save the number back to a string.

#include<stdio.h>
#include<conio.h>
#include<stdlib.h>

#define NUM "8"
int main(int argc, char ** argv)
{
char s1[10];
itoa((atoi(NUM)-1),s1,10);
puts(s1);

getch();
return 0;
}

conio.h is a C header file for old MS-DOS compilers.....:eek: and itoa is not a portable C function.

Only with preprocessor directives...and each time you undefine and redefine NUM so its one less than last.

Maybe if you told us what you were actually trying to do, we could help you figure out a solution? Because doing math on integer strings isn't usually a good idea unless you're in a shell.