Firstly, arrays in C and C++ are not assignable. So, your attempts to assign something to
myData array with
= operator are bound to fail in any case. Copying data into naked arrays should be done either manually or using library functions.
myData array is declared with size
1. It is just one byte. It is too small to store anything useful. It will not magically "stretch" by itself to accommodate more data. If you need to store more data in that array, it is your responsibility to declare with the appropriate size in advance.
Thirdly, what is
"custom string".c_str() supposed to mean??? Something looking very similar to that can be expressed in modern C++ as
using namespace std::string_literals;
but I see no reason for that at all. If your input is a C-string, then function
atoi is directly applicable to C-strings. No need to convert such C-string to
std::string and then back.
atoi is a "dead" function that exists for compatibility with legacy code only. You are not supposed to use
atoi in your code. A C-style string-to-number conversion functions are functions from
strto... group. E.g.
strtol in your case. But in C++ you might have better options, like
std::stoi and such.