I tried to do what Salem told me and i have one error that says that
D:\Microsoft Visual Studio\Work\roman\roman.cpp(9) : error C2440: 'initializing' : cannot convert from 'char' to 'char [40]'
There are no conversions to array types, although there are conversions to references or pointers to arrays
Error executing cl.exe.
i know it should be easy to fix but im stumped
Code:
int rtoa( char value[], const int size){
static char number[40];
char newnum[40]=value[size];
number[0]=(char)0;
int regnum=0;
while(newnum == "M"){
strcmp(number, "M");
regnum+=1000;
}
if(newnum=="CM"){
strcmp(number, "CM");
regnum+=900;
}
if(newnum == "D"){
strcmp(number, "D");
regnum+=500;
}
if(newnum == "CD"){
strcmp(number, "CD");
regnum+=400;
}
while(newnum == "C"){
strcmp(number, "C");
regnum+=100;
}
if(newnum == "XC"){
strcmp(number, "XC");
regnum+=90;
}
if(newnum == "L"){
strcmp(number, "L");
regnum+=50;
}
if(newnum == "XL"){
strcmp(number, "XL");
regnum+=40;
}
while(newnum == "X"){
strcmp(number, "X");
regnum+=10;
}
if(newnum == "IX"){
strcmp(number, "IX");
regnum=+9;
}
if(newnum == "V"){
strcmp(number, "V");
regnum+=5;
}
if(newnum == "IV"){
strcmp(number, "IV");
regnum+=4;
}
while(newnum=="I"){
strcmp(number, "I");
regnum+=1;
}//}
cout<<regnum;
return regnum;}