I can't understand what you mean by changing a c-string.
To extract integers, you can use int atoi(char*) or long atol(char*) which are defined in stdlib.h. However, if you want to do it manually, follow this:
(where 'str' is your c-string and 'a' is the integer where you want to store your answer):
1 2 3 4 5
int a=0,i=0,s=1; //s is to manage sign of the number
if(str[i]=='-'){s=-1;i++;}
elseif(str[i]=='+')i++;
for(;str[i]>='0' && str[i]<='9';i++)a=10*a+int(str[i]-'0');
a*=s;