Arduino JSON exctracting to char array

Hello,

I use ESP8266 and ArduinoJson library. Have troubles with extracting data to my char array variables. JSON lib does extraction just to const char. I can not use const char since my program also writes to this variable.

So far I figured this way:

String q=data["web.user"];

q.toCharArray(web.user,25);

web.user is defined as char[25] (part of structure).

Is there any other more elegant way?

Thank you for replies!

strncpy(web.user, data["web.user"], sizeof(web.user));

Thanks!