Argument of type “const char *” is incompatible with parameter of type “char *”

I'm trying to join "ip-api.com/json/" and declared char "ip_address" but "ip-api.com/json/" is underlined red and says:

argument of type "const char *" is incompatible with parameter of type "char *"
How can it be done?

TCHAR path[_MAX_PATH];
_tcscpy(path, ip_address);
_tcscat("ip-api.com/json/", ip_address);
"ip-api.com/json/" isn't a variable, it's a string literal. You can't modify a string literal - how could that possibly make sense?

Let's say what you wrote was legal. Where would the result of the concatenation be? How could you use that result?
Last edited on
Wow. It's almost if there were a good reason why people get pissed off by crossposting questions to multiple sites...
Is it illegal to learn ip address?
Topic archived. No new replies allowed.