Question: I'm having problem with returning string outside function. Is there some sort of convertion that should be done before ?

I'm using public `const int val_int[ ]` and `const char* val_rom[ ]` outside class.

And inside class:

```
private:
    char* roman;

public:
    char arab2rzym(int arabic) throw (RzymArabException){
        if( arabic < 0){
            throw RzymArabException(arabic + " is too small");
        }
        else if(arabic > 3999){
            throw new RzymArabException(arabic + " is too big");
        }
        std::string roman;

        for(int i=12; i>=0; i--){
            while(arabic>=val_int[i]){
                roman.append(val_int[i]);
                arabic-=val_int[i];
            }
        }
        return roman;

    }

```

Answer: 
I think you should change the signature of the method to:

```
std::string arab2rzym(int arabic)

```

Also, you are shadowing the private char \*roman class variable with the std::string definition in your method, I don't know whether that's the intention here?

By the way, declaring which exceptions a method throws is generally not a good idea in c++, as if you later modify the code to throw a different exception, and forget to update the "throws" declaration then it calls the default unexpected exception handler which terminates the program. One convention is to write the throws declaration at the end of the method definition but then comment it out. That way people using your method know what it throws, but your program wont fall over if you forget to update the definition with the declaration.
if you insist on return char, there are two solution to do that

first, declare a private std::string variable and return it through c\_str

```
private :
   std::string roman;

char const* arab2rzym(int arabic){
        if( arabic < 0){                
            throw RzymArabException(std::to_string(arabic) + " is too small");
        }
        else if(arabic > 3999){
            throw new RzymArabException(std::to_string(arabic) + " is too big");
        }        

        roman.clear();
        for(int i=12; i>=0; i--){
            while(arabic>=val_int[i]){
                roman.append(val_int[i]);
                arabic-=val_int[i];
            }
        }
        return roman.c_str();

    }

```

second, declare roman as static variable

```
    char const* arab2rzym(int arabic){
    if( arabic < 0){
        throw RzymArabException(std::to_string(arabic) + " is too small");
    }
    else if(arabic > 3999){
        throw new RzymArabException(std::to_string(arabic) + " is too big");
    }
    static std::string roman;
    roman.clear();

    for(int i=12; i>=0; i--){
        while(arabic>=val_int[i]){
            roman.append(val_int[i]);
            arabic-=val_int[i];
        }
    }
    return roman.c_str();

}

```

last thing to mention, I don't think RzymArabException(arabic + " is too big");
could do what you want, you should transform arabic to string before you do that

if your compiler support c++11

```
RzymArabException(std::to_string(arabic) + " is too big");

```

if not

```
RzymArabException((char)(((int)'0')+arabic) + std::string("is too big"));

```

better use reinterpret\_cast to cast it