Page 1 of 1

Code no work on esp

Posted: Tue Mar 30, 2021 1:45 am
by Saripudin
Sorry, maybe someone has a solution, I have a problem with converting strings to char aray

void stringTochar (String text)
{
char * tx = text.c_str ();
}
If compiled on board uno / nano / promini it can work, but if on board esp8266 / esp32 an error appears. What's the difference between c ++ Arduino and esp. Thank you

Re: Code no work on esp

Posted: Tue Mar 30, 2021 4:36 am
by ESP_Sprite
It would help if you post the error... for now, I think c_str returns a const char *, so the variable you push it in should have the same type.