i am doing a roman numeral program and i easily got it to convert from regular #s to roman numerals but im having a problem w/ making roman numerals to regular numbers could some one help me please

<code>

#include "stdafx.h"

#include <iostream>

using namespace std;

int rtoa( char value[]){

static char number[40];

unsigned int newnum=value;

//string[0]=(char)0;

// int newnum; const int M=1000;

// static char number[]=value;

for(int i=0;i<3000;i++){

while(number == "M"){

newnum+=1000;

}

if(number=="CM"){

newnum+=900;

}

if(number == "D"){

newnum+=500;

}

if(number == "CD"){

newnum+=400;

}

while(number == "C"){

newnum+=100;

}

if(number == "XC"){

newnum+=90;

}

if(number == "L"){

newnum+=50;

}

if(number == "XL"){

newnum+=40;

}

while(number == "X"){

newnum+=10;

}

if(number == "IX"){

newnum=+9;

}

if(number == "V"){

newnum+=5;

}

if(number == "IV"){

newnum+=4;

}

while(number=="I"){

newnum+=1;

}}

cout<<newnum;

return newnum;}

char * ator(const unsigned int value){

static char string[40];

unsigned int number=value;

string[0]=(char)0;

while(number >= 1000){

strcat(string,"M");

number-=1000;

}

if(number >= 900){

strcat(string,"CM");

number-=900;

}

if(number >= 500){

strcat(string,"D");

number-=500;

}

if(number >= 400){

strcat(string,"CD");

number-=400;

}

while(number >= 100){

strcat(string,"C");

number-=100;

}

if(number >= 90){

strcat(string,"XC");

number-=90;

}

if(number >= 50){

strcat(string,"L");

number-=50;

}

if(number >= 40){

strcat(string,"XL");

number-=40;

}

while(number >= 10){

strcat(string,"X");

number-=10;

}

if(number >= 9){

strcat(string,"IX");

number-=9;

}

if(number >= 5){

strcat(string,"V");

number-=5;

}

if(number >= 4){

strcat(string,"IV");

number-=4;

}

while(number>0){

strcat(string,"I");

number-=1;

}

cout<<string<<endl;

return string;

}

void main(){

unsigned int val; int pick=0;

char valu[40];

while (pick==1||2){

cout<<"Would you like to either: "<<endl;

cout<<" (1) Convert Regular Numbers to Roman Numerals\n";

cout<<" (2) Convert Roman Numerals to Regular Numbers\n";

cout<<" (3) Exit\n";

cin>>pick;

if (pick==1){

cout<<"Enter a regular number: ";

cin>>val;

ator(val);

}

else if(pick==2){

cout<<"Enter a roman numeral: ";

cin>>valu;

rtoa(valu);

}

else{

exit(0);}}

} </code>