Question: I'm getting this error

> 
> deprecated conversion from string constant to `char*`
> 
> 
> 

How would I put a string into a char array. Here is what I tried:

```
char result[];
result = "invalid";

```

**EDIT:**

This is what i'm trying to do

```
bool intToRoman (int val, char result[])
{
   MAIN BODY
   result = "MMM";
}

```

in this function i'm trying change an integer into a roman numeral. in my main body I want to store my string (for example "MMM") into my character array result.

Answer: 
You need to *initialize* the array:

```
char result[] = "invalid";

```

This creates a size 8 array of `char`.

But you may be better off using an `std::string`:

```
std::string result("invalid");

```
If you're planning to change it during runtime, then you can use any of the following options:

```
       char result[] = "invalid"; // 8 bytes in the stack
static char result[] = "invalid"; // 8 bytes in the data-section

```

If you're not planning to change it during runtime, then you can use any of the following options:

```
       const char  result[] = "invalid"; // 8 bytes in the stack
static const char  result[] = "invalid"; // 8 bytes in the data-section
       const char* result   = "invalid"; // 8 bytes in the code-section, and a pointer (4 or 8 bytes) in the stack
static const char* result   = "invalid"; // 8 bytes in the code-section, and a pointer (4 or 8 bytes) in the data-section

```

If you want to initialize it only at a later point during runtime:

```
       char result[] = "invalid"; // 8 bytes in the stack
static char result[] = "invalid"; // 8 bytes in the data-section
...
strcpy(result,"MMM");
// But make sure that the second argument is not larger than the first argument:
// In the case above, the size of "MMM" is 4 bytes and the size of 'result' is 8 bytes

```